Skip to content

Drop a navigation guard that never fired - #809

Open
pleek91 wants to merge 1 commit into
props-on-data-storefrom
drop-dead-navigation-guard
Open

Drop a navigation guard that never fired#809
pleek91 wants to merge 1 commit into
props-on-data-storefrom
drop-dead-navigation-guard

Conversation

@pleek91

@pleek91 pleek91 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description

Stacked on #807. No behaviour change — the code being removed never ran.

setPropsAndUpdateRoute held a guard meant to stop a superseded navigation from acting on props that arrived late:

const currentNavigationId = navigationId

propStore.setProps(to).then((response) => {
  if (currentNavigationId !== navigationId) {
    return
  }

navigationId is a parameter and is never reassigned, so the comparison was always false. It has been that way since it was introduced in ae08389, which set out to "prevent outdated props from triggering context errors" — a real problem the guard never actually prevented.

That job is now done properly: a navigation whose props are discarded returns ABANDONED, which #807 added along with the first test covering the behaviour. With the guard gone the parameter is unused, so it goes too.

@pleek91
pleek91 force-pushed the drop-dead-navigation-guard branch from b38a82c to d212897 Compare August 3, 2026 05:37
@pleek91
pleek91 force-pushed the drop-dead-navigation-guard branch from d212897 to 015c59b Compare August 3, 2026 05:46
@pleek91
pleek91 force-pushed the drop-dead-navigation-guard branch from 015c59b to 3ef6f14 Compare August 3, 2026 05:49
@pleek91
pleek91 force-pushed the drop-dead-navigation-guard branch from 3ef6f14 to dc79771 Compare August 3, 2026 05:51
@pleek91
pleek91 force-pushed the drop-dead-navigation-guard branch from dc79771 to ca99000 Compare August 3, 2026 05:58
It compared a copy of a parameter against the parameter it was copied from,
so the condition was never true. Its job — keeping a superseded navigation
from acting on its own props — is done by the ABANDONED response instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@stackoverfloweth
stackoverfloweth force-pushed the drop-dead-navigation-guard branch from ca99000 to 36ac6d5 Compare August 6, 2026 14:18
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.

2 participants