Skip to content

feat: keep the web app live across tabs and devices - #1458

Merged
xHeaven merged 89 commits into
dev-null-sh:productionfrom
xHeaven:t3/realtime-broadcasting-and-dependency-upgrade
Nov 4, 2026
Merged

xHeaven merged 89 commits into
dev-null-sh:productionfrom
xHeaven:t3/realtime-broadcasting-and-dependency-upgrade

Conversation

@xHeaven

@xHeaven xHeaven commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Replies and messages should appear while you are looking at them. This adds shared broadcasting and Inertia live props across the web app, replacing fast polling with event-driven reads and retaining a slower fallback when the socket is unavailable.

Open threads, feeds, Remotes, notifications, engagement counts, settings, profiles and review lists now hear changes from other tabs and devices. Reconnecting reads the loaded window again without throwing away history, drafts or the reader’s place.

Changes

  • Upgrade inertiajs/inertia-laravel to 3.7.0 and @inertiajs/react / core to 3.11.0; add Laravel Echo and Pusher protocol clients.
  • Announce changes after the outermost transaction commits. Private user channels carry account and messaging invalidations; public channels carry identifiers for public content. Reads still apply the viewer’s authorization and privacy rules.
  • Share subscriptions, coalesce bursts and recover after reconnect, visibility changes and history restoration. Retire queued and in-flight reads when their viewer or target changes.
  • Keep loaded thread/feed/continuation windows, expanded notification groups and Remotes drafts stable. Lists that would move the reader offer an explicit refresh.
  • Deliver call discovery and signalling promptly while retaining required lease renewals. Send stream deadlines with the response that shows each LIVE marker, so it expires locally even offline.
  • Include production’s pending-follow conversion and headline-removal paths in the announcements. Document setup and user-facing behavior.

Review follow-ups

  • Notify recipients when moderation removes an old notification, and keep continuations out of refreshed reply counts.

  • Keep existing visible-card listeners while scrolling; no-op visibility callbacks no longer reread the viewport.

  • Retire an outgoing call’s answer checker with its call, and settle reaction work that becomes stale during a same-account remount.

  • Authorize former pins before returning them to profile feeds, and recover missed deletions while preserving real unpins and undo.

  • Separate live poll/translation reads from action rate limits, retaining the 60-read ceiling.

  • Publish stream changes as invalidations and fetch stream details through the viewer’s block-filtered endpoint. Response deadlines still handle offline expiry.

  • Merge current production without rewriting history. Correct event-theme return typing and test quoting, and normalize server date aliases while preserving the browser clock value.

  • Retry failed visible-card reads through the existing 30-second safety poll, including with a connected socket.

  • Re-read cached stream state through viewer authorization when profile relationship events arrive.

  • Stop late microphone grants after call cancellation, and prevent obsolete setup from installing resources or signalling over a replacement call.

Validation

Local checks on publication head c537edb2c7714c430c987d73a1b35e2f20232d82 (includes production through 344fb653, the CI repairs and all review corrections):

Check Result
composer test:lint Pass; 27 existing warnings
composer test:types Pass; PHPStan and TypeScript
composer test:type-coverage 100%
php artisan wayfinder:generate --with-form Pass
bun run test:unit 269/269
All 101 TSX unit files 1,016/1,016
bun run build Pass
Full parallel PHP CI run with --ci --coverage --exactly=100.0 5,771 tests, 31,250 assertions, exactly 100%

Runtime scenarios cover two clients, socket outages and missed-message draining, read-receipt privacy, access revocation, account changes, loaded histories, thread delete/restore, notifications and asynchronous completion. These are local results; hosted CI is separate.

Visual evidence

The recordings below use fictional local data. Comparisons are base left, feature right. GIFs are previews; MP4 links retain the full recordings. Historical captures retain their actual revisions: the Remotes/continuation/dock pair is d99cd272 → 1654672b; notifications/reports/connections/live comparisons are d99cd272 → 8e88dde5. Corrected refresh/group evidence is 026f5fa8. These were reviewed for applicability; they are not labelled as fresh captures of the latest production branch.

Remotes: loaded history, a draft, live arrival and outage recovery

Remotes comparison

Full MP4

Thread continuations: delete and restore without losing loaded pages

Thread continuation comparison

Full MP4

Notifications arriving on an open page

Notifications comparison

Full MP4

Feed arrivals in two clients

Live feed

Full MP4. Historical 01d3bfc4 two-client demonstration, not a base comparison.

Additional reviewed captures for the dock, review lists, LIVE markers, hover loading and iPhone interactions are in the media comments below.

Device verification

iPhone 18 Pro, iOS 27, Safari simulator, not hardware. Retained device passes cover a live Remotes arrival with the keyboard open and draft kept, outage recovery while reading history, thread delete/restore, notification filtering and expanded-group arrivals, and review-list interactions. Builds are labelled in the device media comment. Desktop/mobile viewport captures cover light and dark at 1440×900, 1366×650 and 390×844; viewport emulation is not presented as device testing.

Corrected delayed-refresh and open-notification-group scenarios each measured 0 layout shift in 36 runs. Hover stability uses per-frame card coordinates because the Layout Instability API does not report a fixed panel moving through style.top. Existing older-history shifts and mobile overflow are disclosed below.

Independent review

Independent gpt-6.1-sol, high reasoning, priority service returned CODE PASS and VISUAL PASS at production 6c8edd6eb4a1425e9625eb5e9938a4eaf0c36b6e → head 83268e8255a908bfc814c1947d6a6eae476538f8. The code reviewer independently passed 61 TSX and 47 Node tests and verified the exact-head validation logs. The visual reviewer inspected 124 PNG states and sampled 20 MP4s; this is not a claim that every video was watched continuously.

Production subsequently advanced to f2423d6c4333cab0d57adb210df7ffed4e46e91b. The prospective merge exposed a missing media-query mock in two realtime thread tests. Publication commit 0d19f716 supplies the same test seam production uses. The affected prospective-merge run is green (38/38); the complete prospective-merge frontend run also passes (981 TSX and 267 Node tests). A fresh independent CODE PASS / VISUAL PASS covers production f2423d6c → 59d82477, including the test-only CI correction and this unchanged media package. A subsequent CI shard returned the two expected org-call starters in reverse SQL row order. Commit 59d82477 makes that existing assertion order-independent, retaining exact starter membership and multiplicity. The full call controller file passes 25 tests. No runtime source was changed or rebased for these publication fixes.

The CodeRabbit follow-ups are independently approved at production f2423d6c → c2c8f14b: CODE PASS / scoped VISUAL PASS. All eight inline findings and the stream/block consistency concern are closed. The reviewer freshly passed 41 TSX and 48 Node tests, verified the exact-head validation logs, and confirmed all 49 published media hashes are unchanged. This renews applicability of the reviewed presentation; it does not claim new browser, device or production-transport certification for these data and request-lifetime fixes.

Production subsequently advanced to 1e206dd7, incorporated through normal merge 2c394627. A fresh independent CODE PASS / scoped VISUAL PASS now covers production 1e206dd790b937b456a3ad7ea1f2189344a5502a → head 538424a6091cde0531585c933bb869e5c764ffc2, including the production CI repairs, card/stream recovery and canceled microphone acquisition. All 12 functional concerns are closed. The reviewer passed 127 focused tests, verified all eight exact-head check logs and all 84 commit entries, and confirmed the 49 media hashes remain unchanged. This renews applicability of the retained presentation evidence; it does not claim fresh browser, device, OS microphone or production-transport certification. Call resource tests use the actual store with controlled RTC/media tracks.

Production is integrated through 53f465702512be405bd4e9cb5bb0c580f9974f55 in normal merges 9fca3dfa and e6bc6da3. The event-theme implementation and Intl/ICU platform requirements match that base; the realtime package versions are retained. Fresh independent CODE PASS / scoped VISUAL PASS covers this base → head e6bc6da3ceb169e5164db380e30e2add7949f6be. The reviewer passed 141 focused tests, verified all eight exact-head checks and all 86 commit entries, and confirmed all 49 media hashes match. Visual PASS renews the applicability of the retained evidence; deployed extensions and hosted CI on this new head remain unverified.

The subsequent production merge 159c52a5 retains both the live moderation badge and production’s WebView detection, together with its topic/search changes. Test-only commit c537edb2 exercises local-login handoff, including callback redemption and keeping the browser signed out. All eight required local checks pass at this head, with PHP coverage exactly 100%; hosted CI is rerunning. Earlier independent verdicts retain their stated revisions.

Limitations

  • Requires the documented WebSocket server, client build configuration and a queue worker. Production transport has not been deployed or certified by these local tests. Delivery is not durable; clients recover by rereading.
  • Native apps do not adopt live updates in this PR. Call lease heartbeats remain. Canceled microphone setup is guarded; broader connected-media and camera ownership is not rewritten.
  • The existing 10,000-character SDP caps can reject offers on hosts with many interfaces. The trimmed-ICE call scenario verifies signalling with valid-size payloads, not unrestricted calling.
  • Former pins wait for an authorized status response before returning to a profile feed. A failed lookup retries on the next profile change, join or history synchronization; there is no autonomous retry timer.
  • Poll and translation reads now have their own 60-per-minute budget. Other existing action limits and the 5-second review-list arrival margin remain.
  • Baseline mobile profile overflow is 8 px. Loading older Remotes history shifts the page on both base and feature (0.0383 desktop / 0.1179 mobile); a 1 px mobile arrival-anchor drift also exists on base.
  • An expanded notification group holds its position and authorized lead actor until it is closed; counts, avatars and members still update.
  • Hover captures use isolated Playwright/Chrome contexts. Delayed/failed reads and thumbnail placeholders are explicitly simulated. There is no phone hover test; hover is mouse-only. Retained recordings are local evidence, not production end-to-end proof.

Summary by CodeRabbit

  • New Features

    • Added live updates across feeds, profiles, notifications, conversations, calls, moderation, and account settings, with catch-up after connection interruptions.
    • Following and Latest logs now reflect new and removed commits as they happen.
    • Live-stream details refresh in place and reflect when streams end.
    • Moderation queues and connection lists show refresh prompts when changes are available.
    • Added setup guidance and configuration options for live updates.
  • Bug Fixes

    • Improved chat recovery after reconnects and account changes.
    • Commit, reply, poll, translation, and link-preview displays better reflect current updates and visibility.

Remaining live candidates

  1. GitHub profile lookup completion: replace the 2-second discovery poll with private completion announcements and reconnect recovery.
  2. Waiting follows and unclaimed profiles: update waiting counts across devices and replace an open placeholder when its owner joins.
  3. Headline recaps: publication, invalidation and expiry, read through the current viewer’s request.
  4. Relationship metadata: follows-you labels after reconnect and block state in an already-open commit menu.
  5. GitHub profile changes: names, avatars and handles in open profiles and previews.

These are follow-ups, not implemented by this PR.

…e missed follows, and catch every listener up after history
@xHeaven
xHeaven merged commit 03a95b7 into dev-null-sh:production Nov 4, 2026
11 checks passed
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.

1 participant