Skip to content

Conversation

@cursor
Copy link
Contributor

@cursor cursor bot commented Dec 3, 2025

### Fix `DataError: integer out of range` for `times_seen`

This PR addresses the `DataError: integer out of range` that occurs when `Group.times_seen` exceeds the 32-bit integer limit.

The `times_seen` fields in `Group` and `GroupTombstone` models have been updated to use `BoundedPositiveBigIntegerField` (64-bit integer) to prevent overflow. A new migration (`1012_increase_times_seen_limit.py`) is included to apply this schema change.

A regression test has been added to verify that `times_seen` can correctly handle values beyond the previous 32-bit limit.

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Open in Cursor Open in Web

@cursor
Copy link
Contributor Author

cursor bot commented Dec 3, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

This PR has a migration; here is the generated SQL for src/sentry/migrations/1012_increase_times_seen_limit.py

for 1012_increase_times_seen_limit in sentry

BEGIN;
--
-- Alter field times_seen on group
--
ALTER TABLE "sentry_groupedmessage" ALTER COLUMN "times_seen" TYPE bigint USING "times_seen"::bigint;
--
-- Alter field times_seen on grouptombstone
--
ALTER TABLE "sentry_grouptombstone" ALTER COLUMN "times_seen" TYPE bigint USING "times_seen"::bigint;
COMMIT;

@getsantry
Copy link
Contributor

getsantry bot commented Dec 25, 2025

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Dec 25, 2025
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants