Skip to content
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

Override ResponseJson::MarkFailed to set application_data_. #738

Merged
merged 5 commits into from
Nov 5, 2021

Conversation

jonsimantov
Copy link
Contributor

@jonsimantov jonsimantov commented Nov 5, 2021

Description

Provide details of the change, and generalize the change in the PR title above.

Setting application_data_ to an empty flatbuffer will prevent application_data_ from being nullptr. This was causing an issue in #737 when AuthResponse::error_code and AuthResponse::error_message were accessing a null application_data_ if the response failed.


Testing

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.

Integration tests to be run.


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

Notes

  • Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
  • Read the contribution guidelines CONTRIBUTING.md.
  • Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.

@google-cla google-cla bot added the cla: yes label Nov 5, 2021
@jonsimantov jonsimantov changed the title Don't try to access error_code if application_data is null. Don't try to access application_data_->error if application_data_ is null. Nov 5, 2021
@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Nov 5, 2021
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Nov 5, 2021
@github-actions
Copy link

github-actions bot commented Nov 5, 2021

✅  Integration test succeeded!

Requested by @jonsimantov on commit b7ca2e2
Last updated: Fri Nov 5 18:13 PDT 2021
View integration test log & download artifacts

@dconeybe
Copy link
Contributor

dconeybe commented Nov 5, 2021

FWIW I don't think that this is the right fix. I think the right fix is to override MarkFailed() in ResponseJson. I considered implementing the same fix (check for application_data_ being empty) in #615 but ended up fixing a lower-level problem in ResponseJson::MarkCompleted().

@jonsimantov
Copy link
Contributor Author

jonsimantov commented Nov 5, 2021

FWIW I don't think that this is the right fix. I think the right fix is to override MarkFailed() in ResponseJson. I considered implementing the same fix (check for application_data_ being empty) in #615 but ended up fixing a lower-level problem in ResponseJson::MarkCompleted().

What should MarkFailed put in application_data_, just an empty flatbuffer? (like it does with the verify failed?) Hmm I think that makes sense now that I write it - let's give it a shot.

@jonsimantov jonsimantov requested a review from dconeybe November 5, 2021 17:50
@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Nov 5, 2021
@github-actions github-actions bot removed the tests-requested: quick Trigger a quick set of integration tests. label Nov 5, 2021
@jonsimantov jonsimantov changed the title Don't try to access application_data_->error if application_data_ is null. Override ResponseJson::MarkFailed to set application_data_. Nov 5, 2021
@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Nov 5, 2021
@github-actions github-actions bot removed the tests-requested: quick Trigger a quick set of integration tests. label Nov 5, 2021
Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just needs a release notes entry.

@@ -666,7 +672,7 @@ code.
([#429](https://github.com/firebase/firebase-cpp-sdk/pull/429)).
- AdMob (iOS): Temporarily pinned AdMob dependency to a special version of the
Google-Mobile-Ads-SDK Cocoapod, "7.69.0-cppsdk", to maintain compatibility
with version 8.x of the Firebase iOS SDK.
with version 8.x of the Firebase iOS SDK.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untabified the file.

@jonsimantov jonsimantov enabled auto-merge (squash) November 5, 2021 18:23
@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Nov 5, 2021
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Nov 5, 2021
@jonsimantov jonsimantov removed the tests: failed This PR's integration tests failed. label Nov 5, 2021
@jonsimantov jonsimantov merged commit b7ca2e2 into main Nov 5, 2021
@jonsimantov jonsimantov deleted the bugfix/auth_response_error_code branch November 5, 2021 22:47
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: succeeded This PR's integration tests succeeded. labels Nov 5, 2021
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Nov 6, 2021
@firebase firebase locked and limited conversation to collaborators Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes tests: succeeded This PR's integration tests succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy