Skip to content

Fix CursorWindow crash when reading LOIs during a re-sync - #3878

Merged
andreia-ferreira merged 1 commit into
masterfrom
andreia/3767/fix-deleteNotIn-during-resyc
Aug 12, 2026
Merged

Fix CursorWindow crash when reading LOIs during a re-sync#3878
andreia-ferreira merged 1 commit into
masterfrom
andreia/3767/fix-deleteNotIn-during-resyc

Conversation

@andreia-ferreira

Copy link
Copy Markdown
Collaborator

Fixes #3767

The LOIs are read from the database through a fixed size cursor window. For small surveys usually all data fits in one cursor window, but for larger surveys this needs to be done in several rounds. If, during this process, a LOI is deleted, then there is a crash since it tries to fetch a row that doesn't exist anymore. This can happen if the map is reading the LOIs from the db while a sync deletes LOIs.

This PR aims to fix that by adding a @Transaction notation to the getByDeletionState so that the whole read sees a single consisten snapshot of the db even if deletions are happening in parallel.

@shobhitagarwal1612 PTAL?

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.04%. Comparing base (ea42f2d) to head (8d705d1).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3878   +/-   ##
=========================================
  Coverage     68.03%   68.04%           
- Complexity     1883     1884    +1     
=========================================
  Files           411      411           
  Lines         10881    10881           
  Branches       1426     1426           
=========================================
+ Hits           7403     7404    +1     
+ Misses         2735     2734    -1     
  Partials        743      743           

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreia-ferreira
andreia-ferreira merged commit 271db44 into master Aug 12, 2026
19 checks passed
@andreia-ferreira
andreia-ferreira deleted the andreia/3767/fix-deleteNotIn-during-resyc branch August 12, 2026 08:51
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.

[Crash] IllegalStateException: Couldn't read row, col from CursorWindow on LocationOfInterestDao

2 participants