Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the way read posts are handled to support an arbitrary read posts limit #1720

Merged
merged 7 commits into from
Oct 20, 2024

Conversation

blahberi
Copy link
Contributor

@blahberi blahberi commented Oct 3, 2024

Context

Currently, read posts are loaded from the room database to memory in a List<ReadPost> during usage. The list is used to mark posts being loaded as read during post parsing. Due to performance reasons (saving the state of the list), the read posts database is limited to 500 entries.

Changes

Change how we handle read posts when new posts are loaded.

We can instead mark loaded posts as read directly from the db.

  • Instead of using a List<ReadPost> to handle read posts, we use ReadPostsListInterface, which contains the necessary methods for marking loaded posts as read.
  • The implementation of ReadPostsListInterface (called ReadPostsList) just uses ReadPostDao.
  • We change parsePostSync() to work with the new ReadPostsListInterface instead.

Since read posts are not loaded to memory anymore, we can now set an arbitrary read posts limit.

Add a setting to customize the read post limit

  • A switch that lets you choose whether you even want a read post limit
  • An input for setting a custom read post limit (default is 500, minimum is 100)
  • A summary of the read post db in "Advanced" preferences, so you can monitor its size.

@Docile-Alligator Docile-Alligator merged commit 6da3636 into Docile-Alligator:master Oct 20, 2024
3 checks passed
@Docile-Alligator
Copy link
Owner

Thank you very much!

@blahberi blahberi deleted the feature/readPosts branch October 21, 2024 21:13
@blahberi blahberi restored the feature/readPosts branch October 22, 2024 14:05
@blahberi blahberi deleted the feature/readPosts branch October 22, 2024 14:06
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.

2 participants