Skip to content
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

fix(common): prevent repeated application of HttpParams mutations #29045

Closed
wants to merge 1 commit into from

Conversation

@JoostK
Copy link
Member

commented Feb 28, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Previously, an instance of HttpParams would retain its list of mutations
after they have been materialized as a result of a read operation. Not
only does this unnecessarily hold onto memory, more importantly does it
introduce a bug where branching of off a materialized instance would
reconsider the set of mutations that had already been applied, resulting
in repeated application of mutations.

Issue Number: #20430

What is the new behavior?

This commit fixes the bug by clearing the list of pending mutations
after they have been materialized, such that they will not be considered
once again for branched off instances.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Alternative to #20610, however this PR keeps the lazy mutation mechanism intact and is therefore much smaller.

/cc @alxhub

fix(common): prevent repeated application of HttpParams mutations
Previously, an instance of HttpParams would retain its list of mutations
after they have been materialized as a result of a read operation. Not
only does this unnecessarily hold onto memory, more importantly does it
introduce a bug where branching of off a materialized instance would
reconsider the set of mutations that had already been applied, resulting
in repeated application of mutations.

This commit fixes the bug by clearing the list of pending mutations
after they have been materialized, such that they will not be considered
once again for branched off instances.

Fixes #20430

@JoostK JoostK requested a review from angular/fw-http as a code owner Feb 28, 2019

@googlebot googlebot added the cla: yes label Feb 28, 2019

@kara kara added the comp: common label Mar 6, 2019

@ngbot ngbot bot added this to the needsTriage milestone Mar 6, 2019

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Apr 6, 2019

@JoostK JoostK removed the PR action: merge label Apr 6, 2019

@alxhub

alxhub approved these changes Apr 19, 2019

@benlesh

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

@JoostK If you need a presubmit run for you, be sure to flag this with "Merge Assistance" so it shows up in the caretaker's workflow :)

@benlesh

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

benlesh added a commit that referenced this pull request Apr 23, 2019

fix(common): prevent repeated application of HttpParams mutations (#2…
…9045)

Previously, an instance of HttpParams would retain its list of mutations
after they have been materialized as a result of a read operation. Not
only does this unnecessarily hold onto memory, more importantly does it
introduce a bug where branching of off a materialized instance would
reconsider the set of mutations that had already been applied, resulting
in repeated application of mutations.

This commit fixes the bug by clearing the list of pending mutations
after they have been materialized, such that they will not be considered
once again for branched off instances.

Fixes #20430

PR Close #29045

@benlesh benlesh closed this in 8e8e89a Apr 23, 2019

BioPhoton added a commit to BioPhoton/angular that referenced this pull request May 21, 2019

fix(common): prevent repeated application of HttpParams mutations (an…
…gular#29045)

Previously, an instance of HttpParams would retain its list of mutations
after they have been materialized as a result of a read operation. Not
only does this unnecessarily hold onto memory, more importantly does it
introduce a bug where branching of off a materialized instance would
reconsider the set of mutations that had already been applied, resulting
in repeated application of mutations.

This commit fixes the bug by clearing the list of pending mutations
after they have been materialized, such that they will not be considered
once again for branched off instances.

Fixes angular#20430

PR Close angular#29045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.