Skip to content

Prevent service-account IDs from breaking statistics reports - #214

Merged
jmgasper merged 1 commit into
masterfrom
fix/statistics-member-identifiers-master
Nov 11, 2026
Merged

jmgasper merged 1 commit into
masterfrom
fix/statistics-member-identifiers-master

Conversation

@jmgasper

@jmgasper jmgasper commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

GET /v6/reports/statistics/design/first-time-submitters returned 500 in dev because a submission memberId ending in @Clients was cast to bigint. Guard the cast inside CASE in both Design and Development first-time-submitter queries, including empty/null and out-of-range identifiers. A WHERE-only filter would not guarantee cast safety under PostgreSQL predicate reordering.

Valid members, earliest submission selection, the three-month window, and maximum ratings retain their existing semantics. No database migration or data modification is required.

Validation: both actual SQL queries pass PostgreSQL 16 integration fixtures containing service accounts, oversized IDs, new/returning/unrated members, multiple submissions, and duplicate ratings. The test uses unique schemas and a rolled-back transaction. CI build/security checks pass.

Deployed as a two-file SQL overlay on each environment's previous running image. Verified image diffs contain only the guarded cast. ECS rollouts completed (dev task revision 354, prod revision 78); live first-time-submitter reports return HTTP 200 in both environments. Dev Design now returns three rows rather than 500; development returns 11 rows. Production Design/Development return 56/231 rows at verification time.

Companion: public statistics UI.

@jmgasper
jmgasper merged commit 5a5f63f into master Nov 11, 2026
3 checks passed
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