-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_Exception: Exception: Could not save product - API V2 - status=0 - errors=null #5864
_Exception: Exception: Could not save product - API V2 - status=0 - errors=null #5864
Comments
@stephanegigandet Could it be that now you return |
I see the same error in Pending contributions, and my edits are not uploaded to the server. |
@stephanegigandet I'm seeing those too, after checking. |
Is there a way to see the actual query that is sent to the server? Could we log it in Sentry? or maybe it's there already, I didn't find it. |
@monsieurtanuki : @g123k and I had a look, it seems it's probably because the app is sending product_type=null to the write API, with null as a string, so the API fails because it's not a valid type. Note that API v2 sends back more details in "status_verbose", could you log it in Sentry? That would help debug future errors.
I will make a fix server side so that "null" is ignored, and we will default to the server product type (food). |
@stephanegigandet The thing is that I expect the error to be in the 'error' field of the json body, not in 'status_verbose'. I've just tried to change the product_type to an unknown value in TEST env, and got this message: Fun fact: I've also tried to save a product with explicitly the same product_type, and I still got the same error message. In the off-dart code, a solution would be to ignore product_type if null / not changed, so that it won't be sent to the server. Working on it. |
I'm hoping this PR will fix openfoodfacts/smooth-app#5864 If we receive product_type=null, we just ignore it. Also refactored the code to remove some duplication.
@stephanegigandet I'm not sure your fix was appropriate enough - anyway, I still had the same "Exception: Could not save product - API V2 - status=0 - errors=invalid_product_type" problem on the beauty.org server after you considered the current issue as fixed. |
@stephanegigandet I believe your fix can only work on the food server. |
If you use API v2, you get an error in status and status verbose: If you use API v3, you get an error in the JSON body:
Changing the product type is currently limited to moderators, that's why you get this message. If the user is not a moderator, we should not offer to change the product type. |
It wasn't deployed on the others yet, I deployed it on all flavors on Friday I think. |
Sentry Issue: SMOOTHIE-3BM
The text was updated successfully, but these errors were encountered: