fix(formulus): sync screen shows correct pending status #522
Merged
najuna-brian merged 1 commit intodevfrom Mar 17, 2026
Merged
fix(formulus): sync screen shows correct pending status #522najuna-brian merged 1 commit intodevfrom
najuna-brian merged 1 commit intodevfrom
Conversation
- Refresh pending count on Sync screen focus (useFocusEffect) so status updates immediately after creating observations - getPendingChanges: treat synced_at 0 as unsynced so new observations are counted whether DB stores null or 0 Made-with: Cursor
najuna-brian
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the sync screen showing "All synced" when there are unsynced observations (#517).
Problem: After creating an observation and opening the Sync tab, the app could still show "All synced" and 0 pending. The count sometimes updated only later.
Cause:
synced_atstored as0instead ofnull; the pending query only checked fornull.Changes:
useFocusEffectto runupdatePendingUploads()andupdatePendingObservations()whenever the Sync screen gains focus, so the status and counts stay correct after creating observations or switching tabs.Q.where('synced_at', 0)next to the existingQ.eq(null)so never-synced observations are included whether the DB storessynced_atas null or 0. Comment updated to describe what “pending” includes.Type of Change
Component(s) Affected
Related Issue(s)
Closes/Fixes/Resolves: Closes #517
Testing
Breaking Changes
If breaking changes, please describe migration steps: N/A
Documentation Updates
Checklist
Thank you for contributing to Open Data Ensemble (ODE)!