Repository navigation
Restore live updates for bulk Mark read - #27
Merged
Merged
Conversation
The bulk mark-read endpoint skipped PocketBase's per-record realtime events, so other open tabs did not see entries change until reload. After the UPDATE, broadcast one "update" event per existing entry to clients subscribed to entries (wildcard or per-record topics), applying the collection's List/View rule per client like PocketBase does. The event record carries only id, is_read and updated instead of the full entry with raw_content; the feed already merges partial records. The feed now debounces its unread/bookmarked count reload on realtime updates, so a burst of 200 events triggers 2 requests instead of 400. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jgordijn
force-pushed
the
t3/b287fafc-live-updates
branch
from
October 13, 2026 15:06
62fd2cb to
8d0091a
Compare
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.
Follow-up to #26 (merged).
Problem
#26 replaced the 200 per-entry PATCHes with one SQL
UPDATE. That also dropped PocketBase's per-record realtime events, so other open tabs didn't see entries change to read until they reloaded.Change
internal/routes/mark_read.go): after the bulkUPDATE, send oneupdateevent per existing entry to clients subscribed toentries/*orentries/<id>. Like PocketBase, it applies the collection's List/View rule for each client. The event record is slim (id,is_read,updated, collection info) instead of the full entry withraw_content.ui/src/routes/+page.svelte): the feed already merges partial records. It now debounces the unread/bookmarked count reload by 300 ms on realtime updates, so a burst of 200 events triggers 2 count requests instead of 400.Verification
Headless Chromium with two tabs against the real binary, 200 unread entries. Tab A clicks Mark read → All entries. Tab B is on All with cards expanded:
go test ./internal/... -count=1passes. The new test checks wildcard and per-record topics, denial for unauthenticated clients, no event for unknown ids, no event on unrelated topics, and noraw_contentin the payload.bunx vitest run: the 3 failures indaily-news/page.test.tsalso fail onmain.🤖 Generated with Claude Code