diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-27 09:16:41 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-27 20:38:18 +0000 |
| commit | 6e5b7eb84b3ca8a902ac4bcbab9c2a9f9ecdee51 (patch) | |
| tree | 854a0efdd71eb7b3267ce92263e688f580333bf4 /docs/how-to/migration-scripts/10-check-git-sync.sh | |
| parent | 04056a12110928e406d2aca456fc3169ae39f8ad (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/how-to/migration-scripts/10-check-git-sync.sh')
0 files changed, 0 insertions, 0 deletions