In my django app I have view which accepts 3 parameters in POST request: login, password, device_id.
If code in view crashes somewhere while processing I see only 2 parameters in sentry (body&curl).
Bug is caused to serialisation issue with None values.
Example curl without bug (device_id is not None):
curl -v -X POST -H "Accept: application/json" --data "{\"username\":\"000\",\"password\":\"qwerty\",\"device_id\":\"iphone\"}" "http://my_host/api/auth/login/"
in sentry I see:
{ device_id: iphone, password: [Filtered], username: 000 }
Example curl with bug (device_id is None):
curl -v -X POST -H "Accept: application/json" --data "{\"username\":\"000\",\"password\":\"qwerty\",\"device_id\":null}" "http://my_host/api/auth/login/"
My code has crashed.
In sentry I see:
{ password: [Filtered], username: 000 }
but I actually have sent 3 parameters in body!
Expected behaviour in sentry:
{ device_id: None, password: [Filtered], username: 000 }
Merge request 566
Several tests fail in my MR because None values appeared in assertion statements, but MR fixes problem with body parameters.
So I have a question to contributors: should I fix all tests to add None values or I did something wrong in my MR and None values are expected to be skiped for some reasons.
As I see in failed tests many None values are really useless but in my case they are necessary. Also there is no separation in serialisation code between this cases (serialising of body params and some others).
I need your advice to complete my MR.
In my django app I have view which accepts 3 parameters in POST request: login, password, device_id.
If code in view crashes somewhere while processing I see only 2 parameters in sentry (body&curl).
Bug is caused to serialisation issue with None values.
Example curl without bug (device_id is not None):
curl -v -X POST -H "Accept: application/json" --data "{\"username\":\"000\",\"password\":\"qwerty\",\"device_id\":\"iphone\"}" "http://my_host/api/auth/login/"in sentry I see:
{ device_id: iphone, password: [Filtered], username: 000 }Example curl with bug (device_id is None):
curl -v -X POST -H "Accept: application/json" --data "{\"username\":\"000\",\"password\":\"qwerty\",\"device_id\":null}" "http://my_host/api/auth/login/"My code has crashed.
In sentry I see:
{ password: [Filtered], username: 000 }but I actually have sent 3 parameters in body!
Expected behaviour in sentry:
{ device_id: None, password: [Filtered], username: 000 }Merge request 566
Several tests fail in my MR because None values appeared in assertion statements, but MR fixes problem with body parameters.
So I have a question to contributors: should I fix all tests to add None values or I did something wrong in my MR and None values are expected to be skiped for some reasons.
As I see in failed tests many None values are really useless but in my case they are necessary. Also there is no separation in serialisation code between this cases (serialising of body params and some others).
I need your advice to complete my MR.