fix: eliminate route transition fallback flash#276
Conversation
Sentry Preview Error TriageNo Sentry errors found for this PR's preview deployment as of Mon, 22 Jun 2026 14:53:26 GMT. This comment updates automatically after each push. |
Code Coverage OverviewLanguages: JavaScript JavaScript / code-coverage/vitestThe overall coverage in the branch remains at 26%, unchanged from the branch. Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b34137779
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7aafd7bcc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 410339dd2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-276-charm.justin-tech.workers.dev | 2b35987 | pr-276 |
Mon, 22 Jun 2026 14:55:26 GMT |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db2632b87b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!room || !allRooms.includes(room.roomId)) { | ||
| useEffect(() => { | ||
| if (!room) return; | ||
| if (!isDirectSpaceChild && !liveDirectParentSpace) return; |
There was a problem hiding this comment.
Do not cache child-declared space parents
When a joined room has an m.space.parent event naming the selected space but that space does not have a valid m.space.child event for the room, this effect still writes space.roomId -> room.roomId into roomToParentsAtom. The rest of the space navigation graph is derived from the parent space's child events via getSpaceChildren/getRoomToParents, so a stale or unaccepted child-declared parent can be persisted and make an unrelated room render as a child of this space until the next reset; only repair the cache from the space's own child event, or validate the parent link before PUT.
Useful? React with 👍 / 👎.
| const canRenderSpaceRoom = | ||
| !!room && | ||
| (isRoom(room) || (developerTools && room.isSpaceRoom() && room.roomId === space.roomId)); |
There was a problem hiding this comment.
Allow call rooms through the space route guard
When a joined voice/call room is opened from a space, the space nav still lists it as a non-space child because room.isSpaceRoom() is false, and Room has a supported call view via room.isCallRoom(). This new guard requires isRoom(room), but isRoom returns false for typed rooms such as RoomType.UnstableCall, so those supported space children now fall through to the join fallback instead of opening. Allow call rooms here, or gate only actual spaces.
Useful? React with 👍 / 👎.
| useSpaces: () => mockUseSpaces(), | ||
| })); | ||
|
|
||
| vi.mock('$utils/room', () => ({ |
There was a problem hiding this comment.
Preserve room utility exports in the mock
Because vi.mock is hoisted, this $utils/room mock is active while the imported roomToParentsAtom module is loaded. That atom module imports getRoomToParents, isValidChild, and mapParentWithChildren, but the mock does not return them, so this new test file can fail at module load with Vitest's missing-export error before any assertions run; spread vi.importActual('$utils/room') or provide those exports.
Useful? React with 👍 / 👎.
Description
Keep joined home and space routes mounted while room/space lists and parent mappings catch up, so navigation does not flash the fallback join card during route, menu, or first-load transitions.
Closes #219
Related to #238
Type of change
Checklist:
Validation:
pnpm lintpnpm fmt:checkpnpm typecheckpnpm test:runpnpm knippnpm buildAI disclosure: