fix(examples-chat): collapse mode routes via UrlMatcher (unbreaks e2e + Vercel)#504
Merged
Conversation
…omponent instance PR #500 added a route entry per (mode, hasThreadId) — six entries total, two per mode. Navigating from `/embed` to `/embed/<id>` was a route CHANGE (different entry), which tore down EmbedMode and remounted it, killing the active stream when the agent auto-created a thread mid-send. Symptom: `examples/chat — e2e` test "failed stream surfaces an alert and the next send recovers" + "core controls expose expected accessible names" both fail because the assistant message never renders (stream died at remount time). Vercel deploy gates on e2e, so prod has been stuck on the pre-#500 bundle. Fix: collapse the per-mode pair into a single route entry via UrlMatcher. Both `/embed` and `/embed/<threadId>` now resolve to the same route, so the component instance survives the navigation and the stream keeps flowing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
#500 broke
examples/chat — e2eandCanonical demo → Vercelon main. Investigation:Diagnosis: #500 added two route entries per mode (
embed,embed/:threadId, etc — six entries total). Navigating from/embedto/embed/<id>is a route change (different entry), which makes Angular tear down + remount the mode component — killing any active stream.Symptom: e2e test
error-handling.spec.ts:5andkeyboard-accessibility.spec.ts:29both depend on sending a message and seeing the assistant message render. After #500, the agent auto-creates a thread mid-send → signal→URL effect firesrouter.navigate('/embed/<new-id>')→ component remounts → stream dies → assistant message never arrives → test fails.Cascade:
Canonical demo → Vercelgates on e2e green, so prod has been stuck on the pre-#500 bundle since merge.Fix
Collapse the per-mode pair into one route entry via
UrlMatcher. Both/<mode>and/<mode>/<threadId>now resolve to the same route, so the component instance survives the navigation and the stream keeps flowing.Test plan
nx build examples-chat-angulargreenexamples/chat — e2e)🤖 Generated with Claude Code