Repository navigation
后端:notification_history 新增 trigger_source 字段并接入三处调用点 - #157
Merged
todosdev[bot] merged 2 commits intoOct 28, 2026
Merged
Conversation
added 2 commits
October 28, 2026 13:06
Record item/api/test provenance, add channel/success/source filters, and update the shared web type. Checkpoint: VsCbE0EXd7kBjUoypDpX1
Keep the local SQLite mock aligned with schema_v2 so API notification history inserts stop failing silently. Checkpoint: NiUhYAs1Z9_CIR-v-mLMS
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.
Summary
trigger_sourceto notification history so every record shows whether it came from an item reminder, an API call, or a channel test.POST /api/notifywrite history (previously it wrote none) and add channel/success/source filters toGET /me/notification-history.Changes
schema_v2with a nullabletrigger_sourcecolumn and a composite(user_id, channel, success, created_at)index.insertNotificationHistoryacceptstrigger_source;listNotificationHistorytakesListHistoryOptions, builds a parameterizedWHEREclause, and keeps the 50-default / 200-max limit.NotifyContextcarriestriggerSource; API pushes tagapi, scheduler reminders tagitem, and channel tests tagtest. Item test notifications remain NULL, outside this task's three call sites.channel,success,trigger_source, andlimit; the worker record and webNotificationHistorytypes include the new field.worker/test/notification-history.test.tscovers writes, filters, route parsing, and both API/test writers; migration expectations were updated across the ledger and setup suites.schema_v1on the first setup call and applyschema_v2on the next, matching existingrunSetupbehavior.Testing
pnpm test— 19 test files, 247 tests passed.pnpm typecheck— web and worker pass.pnpm exec biome linton changed files — clean; repo-widepnpm lintexits 0 with one pre-existing warning inworker/src/routes/items.ts.