Skip to content

Fix nostr sync#37

Merged
hugotiburtino merged 17 commits intocardsboardfrom
fix-nostr-sync
Dec 15, 2025
Merged

Fix nostr sync#37
hugotiburtino merged 17 commits intocardsboardfrom
fix-nostr-sync

Conversation

@johappel
Copy link
Copy Markdown
Collaborator

Zusammenfassung

  • Härtet alle Nostr-abhängigen Board-Flows (Autor-Migration, Sichtbarkeits-Guards, Anti-Resurrection für gelöschte Boards) und verhindert, dass geteilte Boards beim Reload verlieren oder veraltete lokale Karten überschreiben.
  • Optimiert Event- und Cache-Handling im BoardStore: defensives DnD-Merging, bessere LocalStorage/IndexedDB-Strategie, gezieltes Reloading des aktiven Boards, deterministische Time-Stamps und deduplizierte Event-Handler für Boards, Karten und Kommentare.
  • Verbessert Live-Sync und Sharing: konsistente Card-Referenzen, Hintergrund-Subscriptions für jede Karte, robuste Kommentar-Deduplizierung, sowie neue Handler für Card-/Delete-Events inklusive rank-aware Timestamp-Tracking.
  • Infrastruktur & DX: Vitest läuft jetzt in jsdom, neue Unit-Tests für die LWW-Upsert-Guards, CHANGELOG ergänzt, LiaScript-Dialog barriereärmer, Nostr-Abos werden sauber abgemeldet um Memory-Leaks zu vermeiden.

Details

  • Board & Visibility Hardening: generateBoardAuthorMigration, Anti-Resurrection-Schutz und Visibility-Guards verhindern, dass verwaiste oder gelöschte Boards erneut auftauchen; Sharing-Handler behalten lokale Karten bei und synchronisieren persistente Daten zuverlässig.
  • Event-System: Zentralisierte Event-Pipelines für Board/Card/Comment, Caching der letzten Seen-Events, deduplizierte Subscriptions, sowie Hard-Fail-Strategien beim Merge sichern Daten-konsistenz auch bei Race-Conditions und Relay-Flaps.
  • Realtime UX: Kommentar-Live-Sync nutzt nun reaktive Updates + konsistente Tag-Referenzen, Card-Moves verwenden deterministische Zeitstempel, Hintergrund-Subscriptions halten Kartenlisten aktuell ohne Echo-Events.
  • Tooling/Docs: Vitest→jsdom stellt clientnahe Tests sicher; neuer LWW-Guard-Test belegt, dass ältere Card-Events blockiert werden; CHANGELOG + begleitende Docs (inkl. LiaScript Dialog) sind aktualisiert; mehrere Bugfixes dokumentiert.

Tests
pnpm test (Vitest, jsdom) – inkl. neuem LWW-Upsert-Guard-Test
pnpm lint
Manuelle Verifizierung: Board teilen, reloaden, Karten verschieben, Kommentare live hinzufügen, Offline→Online Sync

Dokumentation

  1. ROADMAP.md aktualisiert (nicht nötig – keine neuen Meilensteine geändert)
  2. TESTSUITE/STATUS.md aktualisiert (Vitest-Environment + neuer Guard-Test dokumentiert)
  3. CHANGELOG.md Eintrag erstellt
  4. Feature-/API-Dokumentation angepasst (betroffene Nostr/Sync-Docs & LiaScript-Hinweise)
  5. ARCHITECTURE-/STORES-Dokumentation aktualisiert (Nostr Event Handling & BoardStore Cache-Hinweise)
  6. _INDEX.md aktualisiert (neue/verschobene Docs verlinkt)
  7. Veraltete Docs archiviert oder mit Migration-Notice versehen (ältere Sync-Notizen)
  8. Tests geschrieben/aktualisiert (LWW-Guard + jsdom Setup)
  9. Test-Dokumentation aktualisiert (Status/Testruns)
  10. ROADMAP Status-Update (Phase 3.1/3.3 Fortschritt markiert)
  11. Commit Messages folgen dem type: description-Schema inkl. Doc-Verweise

Folgearbeiten

  • Beobachten, ob neue Hard-Fail-DnD-Strategie bei extrem schnellen Drag&Drop-Serien throttlen muss.
  • Nach dem Merge Follow-up für Auth/Nostr-Store-Integration (SyncManager + AuthStore laut ROADMAP Phase 4).

…plication and timestamp tracking

- Added `handleCardEvent` to process card events, including deduplication and conflict resolution based on timestamps.
- Introduced `handleDeletionEvent` to manage deletion events for boards and cards, ensuring proper timestamp tracking and local storage updates.
- Enhanced the publish functionality for boards and cards, ensuring event IDs are captured and stored immediately after publishing.
- Established subscriptions for board, card, and deletion events, optimizing for recent events and handling shared board updates.
- Improved error handling and logging throughout the event processing and publishing workflows.
- Updated vite.config.ts to use jsdom instead of Playwright for client tests to improve speed and avoid hanging processes.
- Modified vitest-setup-client.ts to include localStorage mock and added matchMedia polyfill for better compatibility with jsdom.
…von Echo-Events und verbessere die Handhabung von Zeitstempeln
… und Hintergrund-Subscriptions für alle Karten
…eloads und verbessere Fehlerbehandlung bei localStorage
…rieren und Cross-Board-Leaks zu verhindern; füge Unit-Test für LWW-Guard hinzu
- Introduced a tombstone registry to prevent resurrection of deleted boards.
- Updated BoardStorage to filter out tombstoned boards during load operations.
- Enhanced deletion event handling to ensure only authorized deletions occur.
- Added tests for deletion authorization and tombstone functionality.
- Updated roadmap and documentation to reflect changes and new features.
- Updated `reconstructBoard` method to handle legacy author formats and infer canonical pubkeys from maintainers.
- Improved visibility checks in `BoardStore` to prevent displaying tombstoned and hidden boards.
- Added defensive filtering for shared boards to exclude deleted and hidden boards.
- Implemented user role checks for board deletion and leaving shared boards.
- Introduced tests for leave requests and shared board notifications to ensure proper functionality.
- Added reset functionality for visibility guards in `BoardStore`.
@hugotiburtino hugotiburtino merged commit bc0e5cf into cardsboard Dec 15, 2025
4 checks passed
@hugotiburtino hugotiburtino deleted the fix-nostr-sync branch December 15, 2025 18:17
@johappel johappel self-assigned this Feb 20, 2026
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.

2 participants