Skip to content

Commit 80441da

Browse files
committed
address copilot review
1 parent 50f935b commit 80441da

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/libs/Navigation/AppNavigator/routerExtensions/addRootHistoryRouterExtensionUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function getRevealDismissState(
121121
// so it does not inflate the computed offset.
122122
const lengthDelta = (state.history?.length ?? 0) - rehydratedHistory.length;
123123
if (lengthDelta > 0) {
124-
Log.info(`[addRootHistoryRouterExtension] reveal committed; freezing history with offset ${lengthDelta}`);
124+
Log.hmmm(`[addRootHistoryRouterExtension] reveal committed; freezing history with offset ${lengthDelta}`);
125125
return {pendingReveal: null, state: {...rehydrated, history: buildPaddedHistory(rehydratedHistory, lengthDelta)}};
126126
}
127127
Log.hmmm('[addRootHistoryRouterExtension] reveal committed with non-positive lengthDelta; no freeze', {lengthDelta});

tests/unit/Navigation/routerExtensions/addRootHistoryRouterExtension.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,12 +695,11 @@ describe('addRootHistoryRouterExtension', () => {
695695
expect(rehydrated.history?.length).toBe(1);
696696
});
697697

698-
it('preserves leading reveal-padding sentinels when a partial state carries them through getRehydratedState', () => {
699-
// Symmetric to the previous test: if a resetRoot DOES install state whose history
700-
// includes leading reveal-padding sentinels (e.g. a captured snapshot), the
701-
// sentinels currently survive and are honoured by the default branch of
702-
// getStateForAction. This validates the documented trade-off in the extension
703-
// ("offset bleeds back if the installed state carries it").
698+
it('drops leading reveal-padding sentinels when a partial state carries them through getRehydratedState', () => {
699+
// Symmetric to the previous test: even if a resetRoot installs state whose history
700+
// includes leading reveal-padding sentinels (e.g. a captured snapshot),
701+
// enhanceStateWithHistory rebuilds history from routes and drops that offset at
702+
// the rehydration boundary.
704703
const factory = createMockRouterFactory();
705704
const enhancedRouter = addRootHistoryRouterExtension(factory)({} as PlatformStackRouterOptions);
706705

0 commit comments

Comments
 (0)