fix(client): stabilize jump anchoring and idle PWA resume#115
Conversation
Code Coverage OverviewLanguages: JavaScript JavaScript / code-coverage/vitestThe overall coverage in the branch remains at 22%, 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: f805840f2f
ℹ️ 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-115-charm.justin-tech.workers.dev | 14d86e6 | pr-115 |
Tue, 16 Jun 2026 18:26:30 GMT |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14d86e6e7a
ℹ️ 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".
| let nextProcessedIndex = getRawIndexToProcessedIndex(currentFocusItem.index); | ||
| if (nextProcessedIndex === undefined && currentFocusItem.eventId) { | ||
| const found = processedEventsRef.current.findIndex( | ||
| (e) => e.mEvent.getId() === timelineSync.focusItem!.eventId | ||
| (e) => e.mEvent.getId() === currentFocusItem.eventId | ||
| ); | ||
| if (found >= 0) { | ||
| processedIndex = found; | ||
| log.log( | ||
| `[PermalinkJump] Found event by ID search: eventId=${timelineSync.focusItem.eventId}, processedIndex=${found}` | ||
| ); | ||
| } else { | ||
| log.log( | ||
| `[PermalinkJump] Event not found in processedEvents yet: eventId=${timelineSync.focusItem.eventId}, processedEvents.length=${processedEventsRef.current.length}` | ||
| ); | ||
| nextProcessedIndex = found; | ||
| } |
There was a problem hiding this comment.
Resolve jump anchors by event id before stale indices
When post-jump pagination loads history above the target, the target's absolute itemIndex shifts, but the old raw index can still resolve to a different row. Because this resolver accepts getRawIndexToProcessedIndex(currentFocusItem.index) before checking currentFocusItem.eventId, the delayed 600/1500/3000 ms re-centers can scroll to whatever event now occupies the stale index instead of the jumped message. Prefer validating the matched row's event id or searching by eventId first whenever it is available.
Useful? React with 👍 / 👎.
Description
Follow-up fixes after merged PRs
#112and#114.This PR does two things:
visibilitychange -> visibleno longer triggers an aggressive claim attempt on every resumeImplementation details:
CLAIM_CLIENTSrecovery back to the existingpageshow[persisted]pathRelated repo history checked before opening this PR:
#109recovery instrumentation work from PR fix(client): stabilize mobile send, jump recovery, and PWA diagnostics #112Related to #103
Related to #109
Type of change
Checklist:
AI disclosure:
This PR updates
RoomTimeline.tsxso a successful jump does not rely on one early row lookup and a short timeout. The jump logic now resolves the target row from the currentfocusItemevent ID when it performs delayed re-centers, schedules several bounded re-centers while media/previews/history continue changing layout, and avoids clearing the highlight while jump-related pagination is still loading. It also adjustsuseAppVisibility.tsso a normal foreground resume without a controller records telemetry but does not immediately sendCLAIM_CLIENTS; the active claim path remains thepageshow[persisted]recovery case that was originally added for stale Safari PWA restores.