syncstorage-rs icon indicating copy to clipboard operation
syncstorage-rs copied to clipboard

Be lenient about accepting numeric for alphanumeric BsoQueryParams

Open jrconlin opened this issue 4 years ago • 1 comments

https://sentry.prod.mozaws.net/operations/syncstorage-prod/issues/8179023/?referrer=github_plugin

Error happens when trying to parse BsoQueryParams::from_request().

My suspicion is that there may be some alphanumeric fields that are being encoded as numeric if no alpha is present. (e.g. "123abc" being encoded as 123000 which is throwing off serde because it's expecting a character array rather than a i64)

jrconlin avatar Jul 23 '20 18:07 jrconlin

Majority of these seem to be due to clients specifying the offset optimization, seen in uri.path. e.g. /1.5/.../storage/history?full=1&newer=1586936981.88&offset=1587583914630:6&limit=1000&sort=oldest

That offset value is provided by the syncstorage server. I wonder how clients are getting this offset w/ the : -- from a legacy syncstorage node? Were they in the middle of paginating through this collection when they were migrated (but this still occurred numerous times over the past couple weeks when migrations were paused).

I'd think syncstorage responding with a 4xx (validation failed) here would "reset" the client to start over, but maybe not? Maybe special casing this to a 5xx instead would accomplish this?

pjenvey avatar Jul 23 '20 19:07 pjenvey