[feat]: add schedule report log persistence#42
Open
not-meet wants to merge 1 commit into
Open
Conversation
not-meet
force-pushed
the
feat/schedule-persistence
branch
2 times, most recently
from
July 22, 2026 22:14
5468ccb to
3f555b8
Compare
not-meet
force-pushed
the
feat/schedule-persistence
branch
from
July 24, 2026 14:37
3f555b8 to
5f376a3
Compare
not-meet
marked this pull request as ready for review
July 24, 2026 16:53
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.
Description
Adds the persistence layer for the scheduled spam-report feature: storing
the active schedule, in-progress setup drafts, and the flag/admin-action
logs the daily report will summarize.
Changes
4 persistence layers were added
AdminActionLogStore
FlagLogStore
ScheduleDraftStorage
ScheduleStore
NOTE -
Known limitation: AdminActionLogStore.log and FlagLogStore.log do read-modify-write against a shared doc, and Apps-Engine's persistence API has no atomic increment/CAS — so concurrent writes to the same user/day can race and clobber each other.
For AdminActionLogStore, exposure is minimal (human-triggered, low frequency). FlagLogStore is the one actually worth thinking about, since the detector can fire multiple flags in a burst — a race there could undercount flagCount/trigger tallies in the daily summary. I considered switching it to append-only (one record per flag, no read), but that shifts cost to read time — the daily summary would need to reduce N raw events into a rollup on every report run instead of reading one doc, and FlagLogStore has meaningfully higher volume than admin actions, so that trade isn't obviously a win. Either way, this only affects report accuracy — flag levels, restriction actions, and enforcement are driven by UserStatusStore, not this log. Leaving as a documented limitation for now.