Repository navigation
canary - #6646
Merged
Merged
canary#6646
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
概要
変更の種類
変更内容
src/hooks/useDeepLink.test.tsxのbeforeEachでjest.useFakeTimers()を有効化し、waitForNavReadyのリトライ列(実タイマー 100/200/400/800ms)をフェイクタイマー上に載せた。既存のafterEachのjest.clearAllTimers()が実効化し、保留コールバックが後続テストの共有navigationRef/dispatchモックへ漏れなくなる。UUID形式でないpresetは無視するの同期点をgetInitialURL呼び出し待ちからinitialUrlProcessed === true待ちへ強化。useLineSelection.handleLineSelectedのlineGroupStations再取得条件をfallbackTrainType(バスの自動選択のみ)からinitialTrainType(指定種別とバスの自動選択の両方)へ拡張。保存時と復元時(openModalByTrainTypeId)で駅一覧の並びが食い違い、directionがずれる問題を解消。lineGroupStationsが空で返った場合は路線単独の駅一覧を残すガードを追加(従来は空配列で潰していた)。pendingStationの引き当てにgroupIdフォールバックを追加。selectionGenerationRefによる選択世代の照合を追加し、路線を選び直した際に古い取得結果が新しいpendingStations/pendingStationを上書きしないようにした。src/hooks/useLineSelection.test.tsxにテスト3件を追加(系統全体への差し替え、空応答時のフォールバック、取得中の路線切り替え)。usePresetCarouselDataの駅データ保持をcarouselDataからの引き当てから、路線ID / 種別(lineGroup)ID をキーにした永続キャッシュ(lineStationsCacheRef/trainTypeStationsCacheRef)へ変更。新規保存したプリセットが空配列で確定し「プリセットの取得に失敗しました」のまま固定されるレースを解消。hasAllStations判定を追加し、fetchKeyの一致だけで取得済みと誤認しないようにした。表示項目だけの更新ではrequestIdを進めず、進行中の取得を打ち切らないよう変更。inFlightFetchKeyRefで同一fetchKeyの二重発行を抑止し、取得完了時の表示組み立てはlatestRoutesRef経由で最新のroutesから行うよう変更。await直後にもrequestIdを検証し、追い越された古い応答が共有キャッシュを汚染しないようにした。応答に含まれなかったキーも取得済みとして記録し、再取得の繰り返しを防止。src/hooks/usePresetCarouselData.test.tsにテスト4件を追加(取得中のroutes再生成、取得中のプリセット追加、重複取得の抑止、古い応答によるキャッシュ汚染の防止)。テスト
origin/dev(7dd8258) をチェックアウトしてローカルで実行し、すべて成功することを確認しました。lint:
Checked 626 filesエラーなしtest: 215 suites / 2280 tests すべて成功
typecheck: エラーなし
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることリグレッションリスク
lineGroupStationsの取得が1回増えるが、fetchStationsByLineGroupIdLoadingは既に方面選択モーダルのローディング判定に含まれているため、スケルトン表示となりUXの退行はない。usePresetCarouselDataの駅キャッシュがフック内で存続するため、同一セッション中は同じ路線 / 系統を再取得しない。取得結果が空だったキーも記録するため、無限に再取得を繰り返すことはない。getPresetRouteEndpointsの解決ロジックには手を入れていないため、既存プリセットの互換性に影響はない。useDeepLink.test.tsxのフェイクタイマー化はテストファイル内に閉じており、afterEachのjest.useRealTimers()で他スイートへ漏れない。製品コードは無変更。dev到達前にレビュー済みの変更で、製品コードの変更範囲はsrc/hooks/useLineSelection.ts/src/hooks/usePresetCarouselData.tsの2ファイルに限定される。関連Issue
スクリーンショット(任意)