Skip to content

Persist Chrome Default Directory#69921

Merged
fluttergithubbot merged 4 commits intomasterfrom
persist-chrome-data
Nov 6, 2020
Merged

Persist Chrome Default Directory#69921
fluttergithubbot merged 4 commits intomasterfrom
persist-chrome-data

Conversation

@grouma
Copy link
Member

@grouma grouma commented Nov 5, 2020

Cache and restore the entire Chrome Default directory across Flutter Tool runs. This ensures that cookies, history and logged in sites are maintained. Related to #53030.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 5, 2020
@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.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

This approach SGTM.

There is an existing test covering the copying logic: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/test/general.shard/web/chrome_test.dart#L204

You could update that just a tad with a file outside of the previous copy dirs to make sure this is covered

@grouma
Copy link
Member Author

grouma commented Nov 6, 2020

Updated the tests. PTAL.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you!

@jonahwilliams
Copy link
Contributor

/tmp/flutter sdk/packages/flutter_tools/lib/src/web/chrome.dart:330: trailing U+0009 tab character
/tmp/flutter sdk/packages/flutter_tools/lib/src/web/chrome.dart:331: trailing U+0009 tab character
/tmp/flutter sdk/packages/flutter_tools/lib/src/web/chrome.dart:332: trailing U+0009 tab character
/tmp/flutter sdk/packages/flutter_tools/lib/src/web/chrome.dart:333: trailing U+0009 tab character
/tmp/flutter sdk/packages/flutter_tools/lib/src/web/chrome.dart:334: trailing U+0009 tab character
/tmp/flutter sdk/packages/flutter_tools/lib/src/web/chrome.dart:335: trailing U+0009 tab character
/tmp/flutter sdk/packages/flutter_tools/test/general.shard/web/chrome_test.dart:233: trailing U+0020 space character

nit: you need to remove the trailing whitespace

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.

I'm assuming this doesn't have the same issues that made @jonahwilliams change it to a new random profile on every run. But it's not clear to me how. Could someone help me understand?

@grouma
Copy link
Member Author

grouma commented Nov 6, 2020

I'm assuming this doesn't have the same issues that made @jonahwilliams change it to a new random profile on every run. But it's not clear to me how. Could someone help me understand?

Chrome must be provided a custom user-data-dir to enable the remote debug port. If you reuse a data dir, Chrome will potentially "attach" to an existing Chrome instance and the remote debug port may silently fail. I believe that's what @jonahwilliams was trying to resolve. As far as I can tell, since we use a different data dir, Chrome will not "attach" to any existing instance and we won't run into debugging issues.

@fluttergithubbot fluttergithubbot merged commit 16daed8 into master Nov 6, 2020
@fluttergithubbot fluttergithubbot deleted the persist-chrome-data branch November 6, 2020 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants