Skip to content

fix(app): allow static segments as siblings of dynamic route segments - #6953

Merged
masenf merged 4 commits into
reflex-dev:mainfrom
benedikt-bartscher:fix-static-dynamic-route-conflict
Aug 27, 2026
Merged

fix(app): allow static segments as siblings of dynamic route segments#6953
masenf merged 4 commits into
reflex-dev:mainfrom
benedikt-bartscher:fix-static-dynamic-route-conflict

Conversation

@benedikt-bartscher

@benedikt-bartscher benedikt-bartscher commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

_find_route_conflict flagged a conflict whenever an existing route's dynamic segment lined up with a different static segment of a new bracket-containing route (e.g. /posts/[id] vs /posts/all/[x]), and only in that registration order. React Router resolves such siblings fine (static wins), so only two dynamic segments with different names at the same position are a real conflict.

Review in cubic

_find_route_conflict flagged a conflict whenever an existing route's
dynamic segment lined up with a different static segment of a new
bracket-containing route (e.g. /posts/[id] vs /posts/all/[x]), and only
in that registration order. React Router resolves such siblings fine
(static wins), so only two dynamic segments with different names at the
same position are a real conflict.
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refines route-conflict detection so static route segments can coexist with dynamic siblings while differently named dynamic segments at the same position remain conflicts.

  • Compares normalized segments from both routes to distinguish static/dynamic siblings from dynamic/dynamic conflicts.
  • Adds regression coverage for both route-registration orders.
  • Adds a bug-fix news fragment.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
reflex/app.py Updates route-conflict detection to permit static and dynamic siblings while retaining rejection of differently named dynamic peers.
tests/units/test_route.py Adds bidirectional regression cases covering static segments alongside dynamic route segments.
news/+static-dynamic-route-conflict.bugfix.md Documents the corrected route-registration behavior and its former order dependence.

Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Aug 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing benedikt-bartscher:fix-static-dynamic-route-conflict (64c7725) with main (bb7ed7c)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@benedikt-bartscher
benedikt-bartscher marked this pull request as ready for review August 27, 2026 08:09
@benedikt-bartscher
benedikt-bartscher requested a review from a team as a code owner August 27, 2026 08:09

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@masenf
masenf merged commit 6c2d707 into reflex-dev:main Aug 27, 2026
111 checks passed
masenf pushed a commit that referenced this pull request Aug 28, 2026
Sample apps, Playwright drivers, NOTES.md and evidence screenshots from
end-to-end browser testing of the routing fixes (#6593 on_load
supersedes, #6790 splat matching, #6953 static/dynamic siblings, #6919
chained-event routing) and the rx.memo changes (#6949 call-site
auto-memoization, #6605 RestProp style classification, #6945
displayName, #6730 wrapper=). Both clusters pass in dev and prod against
the published PyPI alphas, with 0.9.8 baseline comparisons reproducing
the old bugs. Anomalies recorded in each NOTES.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EMjBXPozsNeQNSBZecNH8x
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