Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@Nayuta403
Copy link
Contributor

@Nayuta403 Nayuta403 commented Jun 30, 2022

On rare occasions, we had a crash where the flutterImageView was empty, and according to the stack,it's due to the flutterImageView NullPointerException. I guess is the renderer. addIsDisplayingFlutterUiListener register the callback. But by the time the flutter rendering is done, the platform thread called the detachFromFlutterEngine for some reason (and was faster) and left the flutterImageView empty.
You can evaluate the need for a merger

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

On rare occasions, we had a crash where the flutterImageView was empty, and according to the stack,it's due to the flutterImageView NullPointerException. I guess is the renderer. addIsDisplayingFlutterUiListener register the callback. But by the time the flutter rendering is done, the platform thread called the detachFromFlutterEngine for some reason (and was faster) and left the flutterImageView empty. You can evaluate the need for a merger
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

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.

@Nayuta403
Copy link
Contributor Author

cc @Hixie

@chinmaygarde
Copy link
Member

From Triage: Seems like a sound fix. cc @dnfield for guidance on testing.

@dnfield
Copy link
Contributor

dnfield commented Jun 30, 2022

Change is good, but needs a test.

Suggested test would be to mock the FlutterRenderer passed in, initialize a FlutterView with a FlutterImageView and the mocked renderer, detach the view from the engine (which will null out the image view) and then call the onFlutterUiDisplayed that was given to the mocked renderer.

Without this change, that test will result in an NPE, with it it should succeed.

@dnfield dnfield self-requested a review June 30, 2022 20:36
@Nayuta403
Copy link
Contributor Author

Thanks for your reply. I will supplement the test according to the suggestions later @dnfield

@dnfield
Copy link
Contributor

dnfield commented Jul 3, 2022

LGTM once tests are passing.

@wangying3426 wangying3426 self-requested a review July 4, 2022 02:33
@wangying3426
Copy link
Contributor

LGTM

@wangying3426 wangying3426 added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs tests platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants