Repository navigation
feat(timeline): an hourly tidy drops marks and reactions left on activities that are gone - #662
Merged
Merged
Conversation
…vities that are gone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln25ykE6uBDqx21WBU94SX
21 of 23 tasks
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.
Requested by Adeel · project thread
Description
Before: review marks and reactions on a timeline activity that later went away (an event log entry past
events.keep_days, a deleted asset) stayed inevent_markandevent_reactionuntil the person was removed, so on a long-running install those tables only grew.After: an hourly tidy, run with the other hourly ones in
routines.run_due, drops them. Each pass looks up at most 500 activities marked or reacted to over a day ago, in id order from where the last pass stopped (so the whole table is covered over time), asks every activity source whether each is still there, and deletes the rows of those that are not. Comments on gone activities stay, since they are what people wrote.How:
event_marks.tidy(db, cfg)reusesevents.get_manywith an admin viewer, the same lookup the API uses to read activities by id, so an activity counts as gone only when no source has it.Motivation and Context
A refine-later item of the activity stream design (thread above): "Marks on activities whose rows are gone … stay until the person is removed; a tidy could drop them." Keeps the default install light on a Pi over months of use.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.changelog.d/(timeline-tidy-marks.md).Done questions (AGENTS.md)
events.keep_days, which is already a setting.test_a_tidy_drops_marks_and_reactions_left_on_activities_that_are_gone(a deleted asset and an expired log entry lose their marks and reactions; live ones and day-old-or-newer marks stay; the batch carries on from where it stopped); docs, requirements.md, changelog.d.events.get_many, the hourly tidy slot inroutines.run_due.CI on the PR decides the merge.
Generated by Claude Code