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

[web] improve Firefox launch process #28922

Closed
wants to merge 1 commit into from

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Sep 28, 2021

  • Change the type of Completer<BrowserManager> to Completer<BrowserManager?>. This was causing cryptic stack traces and hanging of the process. Also filed Casting Future<Foo> to Future<Foo?> leads to hard-to-debug errors too easily dart-lang/sdk#47308 about it.
  • Insert a trampoline page between the browser and the test page. Listen to the browser loading the trampoline page and use it as a proof that the browser has successfully launched. If the browser exits before the trampoline page is loaded, abort the launch process.
  • Have Browser retry launching the browser 3 times before giving up.

This is a somewhat speculative fix for flutter/flutter#90831 (I cannot reproduce Firefox crashing locally, so I just emulated the crash)

@yjbanov yjbanov requested a review from mdebbar September 28, 2021 22:47
@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Sep 28, 2021
@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.

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.

Comment on lines +151 to +156
request.response.headers.set(HttpHeaders.contentTypeHeader, 'text/html');
request.response.write('''
<script>
location = ${json.encode(url.toString())};
</script>
''');
Copy link
Contributor

Choose a reason for hiding this comment

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

Clever!

Why not use HTTP redirect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I haven't thought of that :)

@yjbanov yjbanov closed this Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes needs tests platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants