-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[webview_flutter_android] Build Error occured, fixed at line 89 and 200. #9012
base: main
Are you sure you want to change the base?
Conversation
- error reason: Put the same lambda in the removeCallbacks, not recognized as the same object and not removed.
- error reason: Put the same lambda in the removeCallbacks, not recognized as the same object and not removed.
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
That is not one of the test exemption criteria. If this is fixing an issue, it needs some kind of test.
This step is checked, but not completed. We need a detailed issue report explaining how to reproduce this; the PR just says to do a debug build, but we do debug builds as part of our CI, so there must be other steps or configuration necessary to reproduce the problem. Knowing how to reproduce it would inform how to test this in CI. |
@@ -86,7 +86,8 @@ class AndroidWebkitLibraryPigeonInstanceManager( | |||
*/ | |||
var clearFinalizedWeakReferencesInterval: Long = 3000 | |||
set(value) { | |||
handler.removeCallbacks { this.releaseAllFinalizedInstances() } | |||
val runnable = Runnable { this.releaseAllFinalizedInstances() } |
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.
This is bypassing the warning rather than fixing what the warning is flagging, which is that this will not remove the listener added on line 96.
The goal with warnings is to address the cause of the warning, rather than to silence the warning without fixing the underlying problem.
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.
My Kotlin might be slightly off but I think the intended line should be:
handler.removeCallbacks(releaseAllFinalizedInstances)
And the Handler.postDelayed
below needs to be updated as well.
@method76 Thanks for finding this! In this PR you are changing generated code, so we can't accept this as is. I created #9034 to update the pigeon code generator with the fix for this warning. After that lands, the plugin just needs to regenerate code with the latest version of pigeon. Also, the build error is caused by your app configuration where you specifically have warning as errors and have enabled the ImplicitSamInstance lint. The app should still build when the lint is disabled. |
[Issue Summary]
[Reason]
[How is it Fixed]
[Modified File Path]
[Issue Details]
In Kotlin, we can implicitly convert the lambda to a Runnable (SAM conversion) and pass it over, but the problem is that when we put the same lambda in the removeCallbacks, it is not recognized as the same object and cannot be removed.
[Test Exemption related] Just simple modification, so didn't add any additional unit test code.
[Before] Build error message has captured below.
[After] The build error is resolved and the build is successful as like below.
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue.
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3