Skip to content

feat(inbox): Add durable occurrence IDs to event data - #130397

Draft
cvxluo wants to merge 3 commits into
masterfrom
cvxluo/add-durable-occurrence-ids-to-event-data
Draft

cvxluo wants to merge 3 commits into
masterfrom
cvxluo/add-durable-occurrence-ids-to-event-data

Conversation

@cvxluo

@cvxluo cvxluo commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

For idempotency in the inbox, for each inbox event, we need something stable to be able to deduplicate events. For issues, it will be the activity id (for comments / assignments), and for investigations, it will be the seer_run_id and generation_id.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 9, 2026
@cvxluo
cvxluo force-pushed the cvxluo/add-durable-occurrence-ids-to-event-data branch from 8ab076b to 5092d49 Compare November 10, 2026 22:55
@cvxluo
cvxluo force-pushed the cvxluo/define-stable-event-summary-enum branch from e4fedd7 to 1543c33 Compare November 10, 2026 22:55
Base automatically changed from cvxluo/define-stable-event-summary-enum to cvxluo/schedule-retention-beyond-2000-items November 10, 2026 22:55
@sentry

sentry Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 808 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@cvxluo
cvxluo force-pushed the cvxluo/add-durable-occurrence-ids-to-event-data branch from 5092d49 to 8bbc830 Compare November 11, 2026 00:27
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 11, 2026
@cvxluo
cvxluo changed the base branch from cvxluo/schedule-retention-beyond-2000-items to master November 11, 2026 00:30
@getsentry getsentry deleted a comment from github-actions Bot Nov 11, 2026
@cvxluo cvxluo removed the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 11, 2026
cvxluo and others added 3 commits November 11, 2026 11:00
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
@cvxluo
cvxluo force-pushed the cvxluo/add-durable-occurrence-ids-to-event-data branch from 8bbc830 to 54d19e2 Compare November 11, 2026 19:01
@github-actions

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on 439f460 in this run:

tests/sentry/inbox/test_types.py::InboxEventRetentionTest::test_new_events_are_cleaned_on_the_next_sweep_with_ui_disabled — log
[gw3] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/inbox/test_types.py:252: in test_new_events_are_cleaned_on_the_next_sweep_with_ui_disabled
    ISSUE_USER_MENTIONED.record(
E   TypeError: InboxEventType.record() missing 1 required keyword-only argument: 'idempotency_key'
tests/sentry/inbox/test_types.py::RecordTest::test_rollback_does_not_count_recorded_events — log
[gw3] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/inbox/test_types.py:471: in test_rollback_does_not_count_recorded_events
    with transaction.atomic(using=router.db_for_write(InboxItem)):
         ^^^^^^^^^^^
E   NameError: name 'transaction' is not defined

@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/notifications/migrations/0018_inbox_event_idempotency.py

for 0018_inbox_event_idempotency in notifications

--
-- Add field idempotency_key to inboxitemevent
--
ALTER TABLE "notifications_inboxitemevent" ADD COLUMN "idempotency_key" varchar(64) NULL;
--
-- Create constraint inboxevent_item_idempotency_uniq on model inboxitemevent
--
CREATE UNIQUE INDEX CONCURRENTLY "inboxevent_item_idempotency_uniq" ON "notifications_inboxitemevent" ("inbox_item_id", "type", "idempotency_key") WHERE "idempotency_key" IS NOT NULL;

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant