Skip to content

Fix Sentry API input validation and blacklist enum cast - #148

Merged
owens1127 merged 2 commits into
mainfrom
fix-sentry-api-input-validation
Jun 23, 2026
Merged

Fix Sentry API input validation and blacklist enum cast#148
owens1127 merged 2 commits into
mainfrom
fix-sentry-api-input-validation

Conversation

@owens1127

Copy link
Copy Markdown
Contributor

Summary

  • Reject membership IDs above PostgreSQL BIGINT max and duration filters above INTEGER max at route validation, returning 400 instead of unhandled DB errors (Fixes API-12, API-1A, API-1K, API-1Q).
  • Schema-qualify flagging."BlacklistReportSource" on admin blacklist inserts so prod Postgres finds the enum type (Fixes API-1M).

Sentry issues addressed

Issue Error Fix
API-12 / API-1Q value "10000000000" is out of range for type integer zPgInt32() on minDurationSeconds / maxDurationSeconds
API-1A value "46116860184306851060" is out of range for type bigint zBigIntString() capped at PG_BIGINT_MAX
API-1M type "BlacklistReportSource" does not exist Explicit ::flagging."BlacklistReportSource" cast in INSERT

Test plan

  • bun test src/schema/input.test.ts
  • bun run typecheck
  • CI green
  • After deploy: confirm API-12/API-1A return 400 validation errors instead of 500 for bad inputs

Made with Cursor

…rors.

Reject out-of-range membership IDs and duration filters at the route layer, and schema-qualify BlacklistReportSource on admin blacklist inserts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@barecheck

barecheck Bot commented Jun 23, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 91.51%

Your code coverage diff: 0.01% ▴

Uncovered files and lines
FileLines
src/services/reporting/update-blacklist.ts3-39, 43-57

Co-authored-by: Cursor <cursoragent@cursor.com>
@owens1127
owens1127 merged commit e2d647c into main Jun 23, 2026
7 checks passed
@owens1127
owens1127 deleted the fix-sentry-api-input-validation branch June 23, 2026 23:48
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.

1 participant