-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix objects equal to null not being detected as null #11283
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Would it be possible to include a test for this? |
@collinjackson Sorry for the late response. Would a minimal flutter app that triggers the bug be enough as a test? If so, I made an integration test on https://github.com/rafern/flutter_11283_test/tree/master/example. It should fail with the old branch and succeed with the new one |
hi, is it ridiculous of me to ask when this could get reviewed? |
Thanks for your contribution! LGTM for the change. It would be good for us to check in a test that verifies we don't regress this in future. Given the simplicity of this patch and the effect of not having it, I'm fine with landing as-is and following up with a separate patch to land a unit test in the engine to entire we don't regress this. @mklim can provide details on how to write such a test. |
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.
LGTM, thank you for the fix!
I'm not 100% sure, but at a first look I think testing this should be relatively straightforward. Since the tests are new, I expect the most tedious part will be adding a new test file for StandardMessageCodec.java
, following the steps described under "Adding a new test".
Then you'll want to create tests that get the main case of this PR, that null
equivalent input values are written to the output ByteBuffer
in encodeMessage
as NULL
. I'd create a test case passing in a value equaling null
to encodeMessage
and test that the output ByteBuffer
had NULL
written to it, like expected. I'd also double check while writing the test that it was red without the fix here, then green with it, just to make sure I was testing the right case.
There's much more in this class, but just that one minimal test case is enough to cover the fix in this PR.
Merged. @rafern if you do get a moment to write a unit test, please send it along. If you don't think you'll have time to, let us know and I can try to find someone to author one so we don't regress this. |
@cbracken Thank you for merging the PR. I will try to write a unit test tomorrow and inform you in case I fail to figure out how it works |
Thank you so much everyone! |
[email protected]:flutter/engine.git/compare/8a8610a9a514...63873d9 git log 8a8610a..63873d9 --no-merges --oneline 2019-09-16 [email protected] Fix objects equal to null not being detected as null (flutter/engine#11283) 2019-09-16 [email protected] Reset NSNetService delegate to nil,when stop service. (flutter/engine#11270) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
[email protected]:flutter/engine.git/compare/8a8610a9a514...63873d9 git log 8a8610a..63873d9 --no-merges --oneline 2019-09-16 [email protected] Fix objects equal to null not being detected as null (flutter/engine#11283) 2019-09-16 [email protected] Reset NSNetService delegate to nil,when stop service. (flutter/engine#11270) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Hello, I am sorry to ping you all again, however, I agree with @rafern. Is there a way we can include this in a hotfix? I'm seeing this same issue arise in community packages. Developers are using See a discussion at: roughike/flutter_twitter_login#28 |
This PR fixes flutter/flutter#37681 by allowing objects equal to null to be used in the StandardMessageCodec, since JSONObject.NULL.equals(null) is true