Update task task-001
This commit is contained in:
parent
63264cf636
commit
f67ee111e6
|
|
@ -4,7 +4,7 @@ title: offline local storage
|
||||||
status: To Do
|
status: To Do
|
||||||
assignee: []
|
assignee: []
|
||||||
created_date: '2025-12-03 23:42'
|
created_date: '2025-12-03 23:42'
|
||||||
updated_date: '2025-12-04 20:25'
|
updated_date: '2025-12-04 20:27'
|
||||||
labels:
|
labels:
|
||||||
- feature
|
- feature
|
||||||
- offline
|
- offline
|
||||||
|
|
@ -17,23 +17,24 @@ priority: high
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||||
Add IndexedDB persistence layer to the existing Automerge sync system. Board data should be cached locally for offline access, with graceful online/offline transitions.
|
IndexedDB persistence is already implemented via @automerge/automerge-repo-storage-indexeddb. The remaining work is:
|
||||||
|
|
||||||
Key requirements:
|
1. Add real online/offline detection (currently always returns "online")
|
||||||
- Store board state in IndexedDB (not localStorage - 5MB limit insufficient)
|
2. Create UI indicator showing connection status
|
||||||
- Integrate with existing useAutomergeSync hook
|
3. Handle Safari's 7-day IndexedDB eviction
|
||||||
- Detect online/offline status and show connection indicator
|
|
||||||
- Sync local changes when connection restores
|
Existing code locations:
|
||||||
- Handle Safari's 7-day eviction with service worker touch
|
- src/automerge/useAutomergeSyncRepo.ts (lines 346, 380-432)
|
||||||
|
- src/automerge/useAutomergeStoreV2.ts (connectionStatus property)
|
||||||
|
- src/automerge/documentIdMapping.ts (room→document mapping)
|
||||||
<!-- SECTION:DESCRIPTION:END -->
|
<!-- SECTION:DESCRIPTION:END -->
|
||||||
|
|
||||||
## Acceptance Criteria
|
## Acceptance Criteria
|
||||||
<!-- AC:BEGIN -->
|
<!-- AC:BEGIN -->
|
||||||
- [ ] #1 IndexedDB schema for board documents and assets
|
- [ ] #1 Real WebSocket connection state tracking (not hardcoded 'online')
|
||||||
- [ ] #2 Persist Automerge document to IndexedDB on changes
|
- [ ] #2 navigator.onLine integration for network detection
|
||||||
- [ ] #3 Load from IndexedDB on initial page load (before WebSocket connects)
|
- [ ] #3 UI indicator component showing connection status
|
||||||
- [ ] #4 Online/offline status detection with UI indicator
|
- [ ] #4 Visual feedback when working offline
|
||||||
- [ ] #5 Queue local changes during offline and sync on reconnect
|
- [ ] #5 Auto-reconnect with status updates
|
||||||
- [ ] #6 Handle storage quota limits gracefully
|
- [ ] #6 Safari 7-day eviction mitigation (service worker or periodic touch)
|
||||||
- [ ] #7 Safari 7-day eviction mitigation via service worker
|
|
||||||
<!-- AC:END -->
|
<!-- AC:END -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue