Skip to content

[GRDM-58778, 42706] OneDriveファイル/フォルダ取得処理修正 (metadata 422 and download 401)#94

Open
yacchin1205 wants to merge 2 commits into
RCOSDP:developfrom
yacchin1205:feature/onedrive-file-view-fixes
Open

[GRDM-58778, 42706] OneDriveファイル/フォルダ取得処理修正 (metadata 422 and download 401)#94
yacchin1205 wants to merge 2 commits into
RCOSDP:developfrom
yacchin1205:feature/onedrive-file-view-fixes

Conversation

@yacchin1205

@yacchin1205 yacchin1205 commented Jun 16, 2026

Copy link
Copy Markdown

Ticket

GRDM-58778
GRDM-42706

Purpose

OneDrive(拡張ストレージ)で接続したファイルを開く/ダウンロードできない問題を修正する。ファイル参照時に Internal Server Error 等が発生しており、以下2つの原因に対処する。

  1. metadata 取得時の 422: metadata() がファイル(非フォルダ)にも $expand=children を付与している。Microsoft Graph が 2026-03 頃から非フォルダへの $expand=children を getChildrenOnNonFolder("Children cannot be listed from an item that is not a folder")の 422 で返すようになり、ファイル参照が失敗するようになった。 (GRDM-58778)
  2. ダウンロード時の 401: 事前認証済みの @microsoft.graph.downloadUrlAuthorization ヘッダーを重ねて送信しており、一部の OneDrive ホスト(個人アカウント等)が 401 (unauthenticated) を返す。upstream commit ceaf712 と同種の事象。 (GRDM-42706)

Changes

  • metadata(): フォルダ(path.is_dir)の時のみ $expand=children を付与。
  • download(): 事前認証済み downloadUrl では no_auth_header=True で Authorization ヘッダーを送らない。過去版取得の /versions/{id}/content(素の Graph API)は Authorization を維持。
  • onedrive provider のテストを更新。

Side effects

None

QA Notes

  • Unit Testを追加し、GitHub Actionsで実行(本PR): 全てGreen
  • Docker Composeで起動した開発環境にて、OneDrive App(個人アカウントで発行したOAuth App)を設定し、個人アカウントを連携させた状態で以下を確認
    • ファイル/フォルダの表示(expand=childrenの動作確認)
    • 最新ファイル/過去バージョンのダウンロード(no_auth_headerの動作確認)
  • E2E Test Notebookによる回帰テストの実施 https://github.com/RCOSDP/RDM-e2e-test-nb/actions/runs/27657963210 : 全てGreen

@yacchin1205 yacchin1205 changed the title [GRDM-58778] Fix OneDrive file retrieval (metadata 422 and download 401) [GRDM-58778, 42706] Fix OneDrive file retrieval (metadata 422 and download 401) Jun 16, 2026
@yacchin1205 yacchin1205 changed the title [GRDM-58778, 42706] Fix OneDrive file retrieval (metadata 422 and download 401) [GRDM-58778, 42706] OneDriveファイル/フォルダ取得処理修正 (metadata 422 and download 401) Jun 16, 2026
@yacchin1205 yacchin1205 marked this pull request as draft June 16, 2026 08:24
@yacchin1205 yacchin1205 marked this pull request as ready for review June 17, 2026 09:21
@yacchin1205 yacchin1205 requested a review from hide24 June 17, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant