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

✨ Historical read progress tracking #340

Merged
merged 6 commits into from
Jun 1, 2024

Conversation

aaronleopold
Copy link
Collaborator

Resolves #207

This PR splits the read_progresses table into two separate tables:

  • active_read_sessions to track the current reading session for a user+book pair
  • finished_read_sessions to track the past and completed reading sessions for a user+book pair

There were a lot of fundamental changes to filtering on read progress, as well as displaying progress throughout the UI, so I'll be testing these changes before being comfortable merging. A few behavioral notes:

  • A user may have 1 active_read_session per book
  • A user may have any number of finished_read_sessions per book
  • Marking a book as complete sets the started_at and completed_at timestamps to:
    • The same value (current timestamp) if no active_read_session exists
    • The started_at value from active_read_session and the current timestamp, respectively
  • Marking a book as unread will not clear historical record, it will clear the active_read_session if present

I think these changes also open the doors a bit to more time-based statistics features

@aaronleopold aaronleopold force-pushed the al/historical-read-history branch from 16694dd to 863145f Compare May 22, 2024 23:23
@aaronleopold
Copy link
Collaborator Author

I've done a bit more testing and fixed a few small issues. I'll try to simulate an upgrade from the current experimental to test the migration, since I wrote bits of it by hand I'd like to be extra cautious to not mess up peoples' read progress

@aaronleopold aaronleopold marked this pull request as ready for review June 1, 2024 18:57
@aaronleopold aaronleopold merged commit e355932 into experimental Jun 1, 2024
3 checks passed
@aaronleopold aaronleopold deleted the al/historical-read-history branch June 1, 2024 18:58
@aaronleopold aaronleopold mentioned this pull request Aug 15, 2024
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.

1 participant