Repository navigation
fix: a task or note never shows twice while its state changes - #110
Merged
Merged
Conversation
The tasks screen read open and done tasks through two queries combined into one state, so a task that was just checked or unchecked could sit in both lists for a moment and the list crashed on the repeated key. A hidden tag's view did the same with its live and archived notes. Each list now comes from one query.
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.
What and why
Play Console reports
IllegalArgumentException: Key "2" was already used(and"3") from aLazyColumn. The cause is in 2.3.1 and in the 3.0.0 code.getAllTasks), split withpartition. Done tasks are still sorted newest first.NotesDao.getArchivedNotesByTagIdis replaced bygetNotesOfTagWithArchived, one query, and the filter moves intoObserveNotesUseCase.How it was tested
:shared:desktopTestfor the tasks, notes list and repository tests (TasksViewModelTest18/18), and:core:database:testAndroidHostTest(NotesDaoTest19/19):core:database:updateKotlinAbiand:shared:updateKotlinAbi, dumps committedNot verified:
aTaskBeingCheckedOrUncheckedIsNeverInBothListsAtOncetest also passes without the fix. The test repository derives both lists from oneStateFlow, so it cannot reproduce Room's separate query emissions. The fix comes from reading one query. The test only pins the behaviour.Security and data checklist
INTERNETpermission.