mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 07:27:23 +02:00
e9f6d5fc3addeffff4ebae5881496245dda1de35
The real bug: subscription ID was using the original filter (with "$contacts" string)
while the query used the resolved filter (with actual pubkeys). This caused the
subscription to not re-subscribe when contacts were loaded.
Flow before fix:
1. Component renders, contacts = []
2. resolvedFilter has empty authors (since $contacts resolves to [])
3. Subscription ID: req-{"authors":["$contacts"]} (never changes)
4. Query sent with empty authors → no results
5. Contact list loads, contacts populates
6. resolvedFilter recalculates with real pubkeys
7. BUT subscription ID unchanged, so no re-subscribe!
8. Query stuck with empty authors
Flow after fix:
1. Subscription ID now uses resolvedFilter
2. When contacts load and resolvedFilter changes, ID changes
3. Hook detects new ID and creates new subscription with actual contact pubkeys
4. Query works correctly
Also includes the contactPointer memoization from previous commit.
Languages
TypeScript
98.9%
CSS
0.8%
JavaScript
0.3%