feat(formulus): Filter out soft-deleted observations in WatermelonDBRepo and related hooks/services#520
Merged
Mishael-2584 merged 5 commits intodevfrom Mar 17, 2026
Merged
Conversation
…lated hooks/services
…cessary eslint comments in syncNativeVersion script
…prove observation query method
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
Observations are soft-deleted (a
deletedflag is set); the record stays in the database. List APIs and the UI were not filtering by this flag, so deleted observations still appeared on the Observations screen and in formplayer/choice lists.Changes:
getObservationsByFormType()now includesQ.where('deleted', false)so only non-deleted observations are returned. Removed the temporary debug log that printed total observation count.getObservationsByQuery(), whenincludeDeletedis not set, results are filtered to exclude observations withdeleted === true, so choice lists and formplayer only see active observations by default.obs.deleted === trueso the Observations screen never shows soft-deleted items.Delete behavior is unchanged: the record is only updated with
deleted = true; it is not removed from the database. List and detail screens now consistently hide deleted observations.Type of Change
Component(s) Affected
Related Issue(s)
Closes/Fixes/Resolves: Closes #495
Testing
Breaking Changes
If breaking changes, please describe migration steps: N/A
Documentation Updates
Checklist
Thank you for contributing to Open Data Ensemble (ODE)!