feat(pwa): Offline study logging & automatic synchronization queue
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- firebase, react, typescript
Research direction
Start by reading src/components/newnote/hooks/use-note-submission.ts and src/firebase.ts, then inspect the existing /api/groups/post-note flow and test setup. Define the queue in src/utils/offline-sync-queue.ts and the status UI in src/components/common/offline-banner.tsx. Done means offline notes are retained without a blocking error, sync automatically after reconnection, offline status is visible, and existing unit and E2E tests pass.
Written by the indexing model from the issue text.
Description
Problem Statement
Currently, posting a scripture note or completing daily study requires an active network connection (POST /api/groups/post-note). When users study offline (e.g., on airplanes, subways, or in areas with poor reception), submissions fail immediately with a network error toast, disrupting their study streak and workflow.
Proposed Solution
Implement an offline mutation queue (Outbox Pattern) for study notes and streak check-ins:
- Offline Note Queueing (IndexedDB / localStorage):
- When offline (
!navigator.onLineor API call failure due to network), save the pending note submission payload into a local queue. - Show a non-blocking toast: "Saved offline. Your streak and note will sync automatically once connected."
- When offline (
- Auto-sync on Reconnection:
- Listen to
window.addEventListener('online')(or Service Worker Sync if supported). - Drain the offline queue in chronological order, replaying the
POST /api/groups/post-noterequests.
- Listen to
- Offline Status UI:
- Add a subtle offline banner or badge in the navigation/dashboard when disconnected.
- Firestore Offline Persistence:
- Ensure Firestore's
persistentLocalCacheor IndexedDB cache is properly initialized insrc/firebase.tsso users can browse previously fetched scriptures and notes while offline.
- Ensure Firestore's
Target Files
src/components/newnote/hooks/use-note-submission.tssrc/firebase.tssrc/utils/offline-sync-queue.ts(New utility / store)src/components/common/offline-banner.tsx(New component)
Acceptance Criteria
- Submitting a note while offline stores the draft locally and does not show a blocking error.
- When internet connectivity is restored, the queued note is automatically sent to
/api/groups/post-noteand updates the user's streak. - Offline status is clearly communicated in the UI.
- Existing unit and E2E tests pass.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 2
- Avg merge
- 8h 42m
- Merged PRs (30d)
- 34
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ScriptureHabit/scripture-habit
-
[Call for Contributions] Share your funny & relatable LDS / Scripture Study quotes! (Multilingual) Opengood first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
good first issue hacktoberfest help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ScriptureHabit/scripture-habit#257 · 2 comments ·
-
enhancement good first issue help wanted
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
good first issue help wanted
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
good first issue help wanted
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in ScriptureHabit/scripture-habit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·