Repository navigation
fix(booskiff-web): SSR resume 時の /drive DOM 破損を修正し #19 workaround を解除 (#21) - #23
Merged
Merged
Conversation
SSR + resumeMount 経路は mock E2E のカバレッジ穴だった。修正前に red (folder-create-submit が2要素) を確認済み。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
原因: 「何も描画しない」場所の HE.text "" は HTML パースで消滅するが、Flame の hydration は SSR DOM と仮想 children を index のみで対応付けるため、errorBanner 以降の全兄弟が誤った DOM ノードに紐付き、後続 patch が誤ノードを置換・挿入・削除していた (セクション重複・子ノード混入・ハンドラ不活化)。非表示 div (emptySlot) に置き換え、SSR/client 双方に実ノードを常駐させて index 対応を維持する。追加した回帰テストが red → green になることを確認。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…に復帰 (#21) DOM 破損の修正により、OAuth callback 後の /drive フルロードが安全になったため、BFF の next を return_to=/login (SPA 経路回避策) から /drive に戻す。real E2E の永続化検証も API 確認から UI リロード確認 (page.goto("/drive") + folder-list 表示) に復帰。scripts/e2e-real.sh green を確認。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21
原因の特定結果
候補のうち resumeMount + 直後の patch 経路 が原因でした(SSR シリアライズと model round-trip の不一致ではありません)。
HE.text ""(空テキストノード)は HTML 出力上は無になり、ブラウザのパース後 DOM にノードとして存在しません。resumeMount) は SSR DOM と仮想 children を index のみで 対応付け、tag/key/属性の検証も余分ノードの除去も行いません。/driveSSR では Drive root の children[h1, errorBanner(空text), quota, upload, folder, file]の index 1 に空テキストがあり、これが消滅するため errorBanner 以降の全兄弟が 1 つずつ誤った DOM ノードに紐付き ます。CheckSession → SessionChecked → LoadDrive → FilesLoaded/FoldersLoaded/BillingLoadedの patch が走ると、誤ノードの置換・挿入・削除が発生し、フォルダセクション重複 (folder-create-submit/folder-listが2要素)・セクション間子ノード混入・イベントハンドラ不活化が発生していました。修正
App/View/Drive.purs:HE.text ""プレースホルダ 4 箇所を、SSR/client 双方に実ノードが常駐する非表示 div (emptySlot) に置換し、hydration の index 対応を維持。#19 workaround 解除
bff/auth-real.ts: real ログイン成功レスポンスのnextを/auth/oauth/start?return_to=/login(SPA 経路回避策)からreturn_to=/driveに復帰。e2e/real/tests/auth.spec.ts): return_to=/drive 直接遷移に戻し、永続化検証を API 確認から UI リロード確認(page.goto("/drive")+folder-list表示)に復帰。検証
e2e/tests/drive-resume.spec.ts新規追加: 認証済み/driveフルリロード): 修正前 red(folder-create-submitが 2 要素)→ 修正後 greenscripts/e2e-real.sh: 4 passed(workaround 解除後)scripts/e2e.sh: 17 passed(既存 16 件無回帰 + 新規 1 件)bun test bff/: 99 pass / 0 fail(next期待値を/driveに更新)spago test: greenOut of scope(実装パケット通り、未着手)
nextの 1 行変更は booskiff-web: 認証済み /drive のフルページロードで resume DOM が破損する (フォルダセクション重複・ハンドラ不活化) #19 workaround 解除の一部であり領域侵害ではない)