-
-
Notifications
You must be signed in to change notification settings - Fork 206
fix: SDK crashes due to missing error code property in ParseNetworkResponse.data
#802
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
fix: SDK crashes due to missing error code property in ParseNetworkResponse.data
#802
Conversation
I will reformat the title to use the proper commit message syntax. |
Thanks for opening this pull request!
|
Codecov ReportBase: 3.35% // Head: 10.67% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #802 +/- ##
==========================================
+ Coverage 3.35% 10.67% +7.31%
==========================================
Files 5 47 +42
Lines 268 2810 +2542
==========================================
+ Hits 9 300 +291
- Misses 259 2510 +2251
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
statusCode
statusCode
statusCode
not exist in ParseNetworkResponse.data
statusCode
not exist in ParseNetworkResponse.data
code
not exist in ParseNetworkResponse.data
What side effects could that change have? The way of building the error response with |
I did various tests and found out that sometimes the |
So the underlying issue is that Parse Server sometimes doesn't send that code? |
yes for example {"error":"unauthorized"} |
Got it, I'm a bit careful about introducing this ambiguity. It basically means that a developer cannot be sure whether the code is a parse error code or a http response code, right? For example, if the error code is 400 and Parse Server also has a Parse Error code 400, how should a developer interpret this, and how should error handling logic in an app deal with this? Maybe an alternative would be to use a distinct generic Parse Error code if no specific error code is present. For example the docs already offer |
It is true that the developer is not able to understand the meaning of the |
packages/dart/lib/src/objects/response/parse_error_response.dart
Outdated
Show resolved
Hide resolved
and set ParseError.otherCause in parse_error_response.dart and parse_exception_response.dart
Changed and added const error code based on Parse-SDK-JS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me; unless we get contrary feedback regrading the 3 removed codes.
- Is the PR title correct?
- Could you add the changelog entry by copy/pasting the PR title + bump the version for the release?
code
not exist in ParseNetworkResponse.data
ParseNetworkResponse.data
@mbfakourii You have been quite active recently and make some great contributions. Can I add you to the review team of the Parse Flutter SDK? You would get notified if there are PRs to review. |
ParseNetworkResponse.data
ParseNetworkResponse.data
ParseNetworkResponse.data
ParseNetworkResponse.data
Yes, I will be happy to add and title added in changelog |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
New Pull Request Checklist
Issue Description
sometimes in buildErrorResponse
code
not exist inapiResponse.data
andjson.decode
can't parse it!but statusCode exist in ParseNetworkResponse and can be taken from this variable.
Related issue: #799
Closes: #799
Approach
In some times when the
code
is not available inParseNetworkResponse.data
, thestatusCode
is used in theParseNetworkResponse.statusCode
variable.TODOs before merging