Skip to content

fix(router): match the current URL when probing it - #288

Merged
erkamyaman merged 1 commit into
mainfrom
fix/router-probe-same-url
Oct 11, 2026
Merged

erkamyaman merged 1 commit into
mainfrom
fix/router-probe-same-url

Conversation

@erkamyaman

@erkamyaman erkamyaman commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

What and why

The navigate tool's probe action and the panel's Probe in app button are documented as running the real matcher without navigating. #250 stopped a probe of the current URL from hanging for 10s, but the answer it now gives is still wrong. With the default onSameUrlNavigation: 'ignore', Angular emits NavigationSkipped before route recognition, so probing the URL the app is already on returned:

{ "matched": false, "reason": "Navigation to /users/8 was ignored because it is the same as the current Router URL." }

That reads as "no route matches this URL", and no route, params or guards come back. Probing the current route is a natural thing to do when checking why it renders the wrong thing.

The probe now passes onSameUrlNavigation: 'reload' along with skipLocationChange. The router recognizes the current URL, the probe aborts right after RoutesRecognized as it does for any other URL, and router.url stays the same.

How it was verified

The real-Router test added in #250 now expects matched: true (and still no timeout, with the URL unchanged). On main it fails with matched: false. With the fix it passes. All package tests pass. Like the other probe tests, it is skipped before Angular 20.2.

  • pnpm commit:check (commit messages follow the guidelines)
  • pnpm format:check
  • pnpm typecheck (includes the ngc template checks)
  • pnpm test:devtools (all passing)
  • pnpm skills:check (when .claude/ changed): not changed
  • No docs change needed: the fix makes the code match existing docs (no-docs)
  • pnpm extension:build and extension/ui committed (when app/ changed): not changed
  • Checked in the browser with axe (when the UI changed): no UI change

Summary by CodeRabbit

  • Bug Fixes
    • Route probes now correctly match when checking the current URL, instead of being skipped as same-URL navigations. The router reloads the current route during the probe and remains on that URL afterward, providing a reliable match result without changing the displayed location. This improves route-checking behavior when the URL is already active.

The probe action navigates with skipLocationChange and the router's
default onSameUrlNavigation 'ignore'. For the URL the app is already on,
Angular emits NavigationSkipped before recognizing routes, so the probe
answered matched: false with an "ignored" reason, which reads as "no route
matches this URL". The probe now passes onSameUrlNavigation 'reload', so
the current URL is recognized; the probe still stops right after
recognition and the URL stays the same.
@erkamyaman erkamyaman added the no-docs This pull request needs no docs change (the reason is in the description) label Oct 11, 2026
@erkamyaman erkamyaman added the no-docs This pull request needs no docs change (the reason is in the description) label Oct 11, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
0bfec2a 2026-10-11T03:21:10.448Z View logs ↗

@github-actions github-actions Bot added the area: package The ng-devtools package (packages/ng-devtools) label Oct 11, 2026
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 80ca4852-907d-4614-853c-42b63a622d92

📥 Commits

Reviewing files that changed from the base of the PR and between 58273c6 and 0bfec2a.


📒 Files selected for processing (2)
  • packages/devtools/src/__tests__/router-features.test.ts
  • packages/devtools/src/router-actions.ts

Limit details: You’ve used all 10 included reviews currently available.



📝 Walkthrough

Walkthrough

The probe action now requests a reload when navigating to the active URL. The test expects the probe to match that URL and leave the router at /users/8.

Changes

Probe navigation

Layer / File(s) Summary
Reload the active URL
packages/devtools/src/router-actions.ts, packages/devtools/src/__tests__/router-features.test.ts
The probe passes onSameUrlNavigation: 'reload' to navigateByUrl. The test now expects a successful match when probing the active URL.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 0bfec

Probing the active URL now reaches route recognition and reports a match while preserving the router URL. No merge-blocking behavior is established.

Architecture Summary

Architecture risk: 🔵 Low · up to 0bfec

The change affects 1 system.

Changed systems: packages/devtools

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/devtools (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/devtools/src/tests/router-features.test.ts: The test description now states that probing the URL already active in the router matches it, replacing the expectation that the probe is skipped.
  • observed — Modified behavior in packages/devtools/src/tests/router-features.test.ts: The probe result assertion changes from expecting matched: false with an ignored reason to expecting matched: true.
  • observed — Modified behavior in packages/devtools/src/router-actions.ts: The probe navigation now sets onSameUrlNavigation to 'reload'; previously it passed only skipLocationChange.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: making the router probe match the current URL.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 2
  • Waived: $0.50 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.


Comment @coderabbitai help to get the list of available commands.

@erkamyaman
erkamyaman merged commit 4b10701 into main Oct 11, 2026
7 of 9 checks passed
@erkamyaman
erkamyaman deleted the fix/router-probe-same-url branch October 11, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: package The ng-devtools package (packages/ng-devtools) no-docs This pull request needs no docs change (the reason is in the description)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant