Message pagination now constrains client-provided cursors to the PostgreSQL integer range used by `messages.id`, preventing oversized values from raising database errors while preserving before/after pagination semantics. ## Closes - [CW-7922](https://linear.app/chatwoot/issue/CW-7922/harden-backend-paths-causing-production-sentry-errors) - [Sentry 7663397140](https://chatwoot-p3.sentry.io/issues/7663397140/) - [Sentry 7663397546](https://chatwoot-p3.sentry.io/issues/7663397546/) - [Sentry 7663464772](https://chatwoot-p3.sentry.io/issues/7663464772/) ## How to reproduce Request conversation messages with an extremely large `before` or `after` cursor, such as `4611686018427387903`. PostgreSQL previously rejected the value as outside the range for the integer `messages.id` column. ## What changed - Normalize message cursors before they reach the query. - Clamp them to the valid signed 32-bit integer ID range. - Cover oversized `before` and `after` cursors with finder specs.
1.9 KiB
1.9 KiB