Skip to content

fix(overlay): only clear duplicate containers from different platform #17006

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

Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Sep 8, 2019

Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from.

Fixes #16851.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Sep 8, 2019
@crisbeto crisbeto requested a review from jelbourn as a code owner September 8, 2019 11:12
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 8, 2019
@crisbeto crisbeto force-pushed the 16851/duplicate-containers-platform branch 2 times, most recently from baf8cc8 to 1b30154 Compare September 8, 2019 12:43
@@ -63,6 +68,11 @@ describe('MatSelectHarness', () => {

/** Shared tests to run on both the original and MDC-based select. */
function runTests() {
afterEach(() => {
// Angular won't call this for us so we need to do it ourselves to avoid leaks.
overlayContainer.ngOnDestroy();
Copy link
Member Author

Choose a reason for hiding this comment

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

We need these changes, because the changes to the container revealed that the tests here are leaking overlay containers. I've fixed it for all harnesses in #17007.

@crisbeto crisbeto force-pushed the 16851/duplicate-containers-platform branch 2 times, most recently from dca378f to f11389b Compare September 13, 2019 21:07
@crisbeto
Copy link
Member Author

Addressed the feedback @jelbourn.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 13, 2019
@ngbot
Copy link

ngbot bot commented Sep 13, 2019

I see that you just added the pr: merge ready label, but the following checks are still failing:
    failure status "ci/circleci: ivy_test" is failing
    pending status "ci/circleci: tests_saucelabs" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@crisbeto crisbeto force-pushed the 16851/duplicate-containers-platform branch 2 times, most recently from 539c6a9 to ea785ba Compare September 28, 2019 11:20
@zawislakdawidj
Copy link

Any updates on this? I'm seeing issues due to #16851 and verified that this PR resolves them.

@jelbourn jelbourn added the presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged label Dec 4, 2019
@jelbourn
Copy link
Member

jelbourn commented Dec 4, 2019

Looks like this has 80+ failures inside Google for a number of projects. Will require further debugging

@crisbeto crisbeto force-pushed the 16851/duplicate-containers-platform branch from ea785ba to 299e423 Compare December 15, 2019 12:48
@crisbeto
Copy link
Member Author

I'm bumping the priority on this, because we keep getting reports about it.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 15, 2019
@crisbeto crisbeto force-pushed the 16851/duplicate-containers-platform branch from 299e423 to 97c67f1 Compare December 27, 2019 14:25
@jelbourn
Copy link
Member

jelbourn commented Jan 23, 2020

I spent a bit debugging this. Turns out that people have been unintentionally depending on the current behavior in their unit tests in that it guarantees that there's exactly one overlay container. With the changes in this PR, overlay containers aren't cleaned up between specs, so tests just start failing whenever they expect something about a particular overlay container and get a different one (one test I looked at had 21 overlay containers). This is pretty widespread; the change breaks 170 test targets.

I feel like the real solution would be to introduce something like OverlayTestingModule that automatically fakes/clears the overlay container, but I'm open to other ideas.

@crisbeto
Copy link
Member Author

That's interesting, considering that we weren't clearing the overlay containers for at least two and a half years. I'm pushing a change that'll clear them if it detects that it's running inside in a testing context with a TODO to remove it once we have an overlay testing module.

Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from.

Fixes angular#16851.
@crisbeto crisbeto force-pushed the 16851/duplicate-containers-platform branch from 97c67f1 to e5c93fc Compare January 24, 2020 06:37
@jelbourn jelbourn removed the presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged label Jan 27, 2020
@jelbourn jelbourn merged commit 29eec77 into angular:master Jan 27, 2020
jelbourn pushed a commit that referenced this pull request Jan 27, 2020
…#17006)

Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from.

Fixes #16851.

(cherry picked from commit 29eec77)
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
…angular#17006)

Currently we clear all overlay containers when we create a new one as a way to avoid duplicate content coming in from the server. Our current approach is a little too aggressive, because it can pick up containers from different apps. These changes add an extra attribute to the container so that we can determine which platform it's coming from.

Fixes angular#16851.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing "previous" Overlay containers breaks other OverlayContainer instances
4 participants