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

@JoostK JoostK 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

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
@JoostK JoostK requested a review from a team as a code owner February 28, 2019 23:54
@kara kara added the area: common Issues related to APIs in the @angular/common package label Mar 6, 2019
@ngbot ngbot bot added this to the needsTriage milestone Mar 6, 2019
@JoostK JoostK added effort1: hours action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release risk: low type: bug/fix labels Apr 6, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Apr 6, 2019
@JoostK JoostK removed the action: merge The PR is ready for merge by the caretaker label Apr 6, 2019
@JoostK JoostK added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 20, 2019
@benlesh benlesh added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Apr 23, 2019
@benlesh
Copy link
Contributor

benlesh 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
Copy link
Contributor

benlesh commented Apr 23, 2019

presubmit

benlesh pushed a commit that referenced this pull request Apr 23, 2019
…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 pushed a commit to BioPhoton/angular that referenced this pull request May 21, 2019
…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
@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 Sep 14, 2019
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 action: presubmit The PR is in need of a google3 presubmit area: common Issues related to APIs in the @angular/common package cla: yes effort1: hours merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note risk: low target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants