upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/tutorials/first-audit.md
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-27 09:16:41 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-27 20:38:18 +0000
commit6e5b7eb84b3ca8a902ac4bcbab9c2a9f9ecdee51 (patch)
tree854a0efdd71eb7b3267ce92263e688f580333bf4 /docs/tutorials/first-audit.md
parent04056a12110928e406d2aca456fc3169ae39f8ad (diff)
fix(sync): Remove .since() filter from database queries in load_existing_events()
Root cause: `last_connected` was set to Timestamp::now() BEFORE load_existing_events() was called (line 425), causing the database query to filter out all existing events with .since(current_time). The query became: SELECT * FROM events WHERE created_at >= <now> Result: 0 events returned (nothing has created_at in the future) Solution: Remove .since() filter from database queries entirely. The `last_connected` field is now only used for WebSocket subscription filters to avoid re-fetching events from remote relays on reconnect. Rationale for this approach over reordering operations: - Database queries are fast (indexed by kind and created_at) - Loading all events on startup ensures consistency - Eliminates subtle ordering dependency that could break in refactoring - Cleaner mental model: database = full load, WebSocket = incremental This fixes the issue where ~190 state events weren't being fetched after deploying the database query fix (commit 4162c90). Evidence: Production logs showed "Loaded announcements from database count=0" when there should have been hundreds of announcements.
Diffstat (limited to 'docs/tutorials/first-audit.md')
0 files changed, 0 insertions, 0 deletions