-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update status storage, fragments (#1249)
# Status storage Re-work how statuses are stored and managed to separate the cached home timeline from the cached notification timeline. Previously, the home timeline pulled all statuses in `StatusEntity`. Since that table also includes statuses that are referenced from `NotificationEntity` this could show the wrong data. It also makes it difficult to cache other timelines in the future. To fix this: - Introduce `TimelineStatus` which associates a given timeline with the statuses on that timeline. - Use the the `StatusEntity` table as a general cache of statuses. wherever they're used. - Create the home timeline by joining `TimelineStatus` (where the timeline's kind is `Home`) with the statuses in `StatusEntity`. This has a number of knock-on effects. - Deleting from the home timeline now deletes the association from `TimelineStatus`. The cached status is unaffected, so if it is referenced from another cached timeline (currently, notifications) there is no change. - Modifying a status on one timeline (translating, expanding, collapsing, etc) modifies it on all timelines that reference that status. - `cleanup()` and related functions no longer need to take `limit` or `keep` parameter, as it's known whether a status is referenced from a timeline. Rewriting one of the queries exposed an issue where `TimelineDaoTest` run locally could return different (incorrect) results to the same test run on a device (https://issuetracker.google.com/issues/393685887). So re-implement `TimelineDaoTest` as an `androidTest`, and update the CI workflow to include a step to run these tests on an API 31 emulator. # Repositories - Allow `null` as an initial key. # Fragments - Remove unnecessary `refreshAdapterAndScrollToVisibleId`.
- Loading branch information
1 parent
ecb0f7c
commit 1611e48
Showing
19 changed files
with
2,440 additions
and
175 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.