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

Conversation

@ditman
Copy link
Member

@ditman ditman commented Jan 23, 2024

While debugging a different issue, @elliette identified a problem with the web engine when a flutter web app hot-restarts.

TL;DR: the engine is requesting the framework to re-render a view as it tears them down, causing an assertion failure.

This fix stops listening to changes on view "disposed" events when the engine itself is being disposed, so it doesn't trigger re-renders for views that are never coming back.

Issues

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 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.

@ditman ditman requested a review from mdebbar January 23, 2024 03:27
@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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jan 23, 2024
Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

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

There are some conflicts that need to be resolved but this LGTM!

@ditman ditman force-pushed the web-cleanup-view-disposed-listener branch from 8107caa to c93a7a9 Compare January 26, 2024 01:47
@ditman ditman added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 26, 2024
@auto-submit auto-submit bot merged commit eb46604 into flutter:main Jan 26, 2024
@ditman ditman deleted the web-cleanup-view-disposed-listener branch January 26, 2024 02:35
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 26, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jan 26, 2024
…142290)

flutter/engine@9142fc4...8a81e53

2024-01-26 [email protected] Roll Dart SDK from 00784f1f22b5 to 6f8bcd5b48ab (1 revision) (flutter/engine#50074)
2024-01-26 [email protected] [web] Add `views` proxy and `getInitialData`. (flutter/engine#49320)
2024-01-26 [email protected] [web] Prevent re-rendering disposed views when the engine hot restarts. (flutter/engine#49958)
2024-01-26 [email protected] Roll Dart SDK from 2fb950853f06 to 00784f1f22b5 (3 revisions) (flutter/engine#50068)
2024-01-26 [email protected] Avoid sizing `ImageReaderSurfaceProducer` smaller than 1x1 (flutter/engine#50066)
2024-01-26 [email protected] Use clamp sampling mode in external texture. (flutter/engine#50063)
2024-01-26 [email protected] Reland Optimizations for TLHC frame rate and jank (flutter/engine#50065)
2024-01-25 [email protected] Roll Fuchsia Linux SDK from Igt2rE-R6rgfmTRaF... to WHlwlOwznFknNm5IS... (flutter/engine#50059)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from Igt2rE-R6rgf to WHlwlOwznFkn

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],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Error in the JS console when hot restarting.

2 participants