Skip to content

fix(apotheke): period-scoped stats, checked writes, transactional streaks - #496

Merged
forkwright merged 1 commit into
mainfrom
fix/apotheke-stats-store
Jul 2, 2026
Merged

fix(apotheke): period-scoped stats, checked writes, transactional streaks#496
forkwright merged 1 commit into
mainfrom
fix/apotheke-stats-store

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Closes #405, #406, #407, #450, #451.

kanon gate --full green.

Follow-up filed: #492 (repo-wide zero-row-write class + a lint to guard it).

…eaks

- #405: top_items aggregates over play_sessions scoped to the query period,
  instead of returning lifetime play counters for a date-range query.
- #406: rank_table_for returns a hard UnknownMediaType error for an unknown
  media type instead of silently returning music quality ranks; kritike's
  health report skips the unknown type best-effort, assessment propagates.
- #407: update_streak runs its read-modify-write inside one BEGIN IMMEDIATE
  transaction, closing the duplicate-active-streak and streak-loss races.
- #450: user and API-key write functions return NotFound when the target id
  matches zero rows, instead of silently succeeding.
- #451: revoke_api_key is user-scoped (WHERE id=? AND user_id=?); the
  unscoped variant is removed (least privilege), closing a cross-user IDOR.

Closes #405
Closes #406
Closes #407
Closes #450
Closes #451

Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:501fc3306d6a07ca729dbe580b7453c3dad6b236
@forkwright
forkwright merged commit 9673863 into main Jul 2, 2026
11 checks passed
@forkwright
forkwright deleted the fix/apotheke-stats-store branch July 2, 2026 15:31
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.

top_items returns lifetime play counters for a date-range-scoped query

1 participant