Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

feat(common): TransferHttpCache now respects url params#1005

Merged
CaerusKaru merged 3 commits intomasterfrom
fabian/cache-params
Jun 9, 2018
Merged

feat(common): TransferHttpCache now respects url params#1005
CaerusKaru merged 3 commits intomasterfrom
fabian/cache-params

Conversation

@Toxicable
Copy link
Copy Markdown

@Toxicable Toxicable commented Jun 2, 2018

Based on the work in #987

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Feature

What is the current behavior?

TransferHttpCache does not respect url params
Issue Number: #927

What is the new behavior?

Now respects params

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Other information

Technically this is a breaking change since
before:
/my/url?key=value
/my/url
Both of these would override each others values in the cache
But now they'd have their own cache

@Toxicable
Copy link
Copy Markdown
Author

Blocked on being able to add tests

@Toxicable Toxicable mentioned this pull request Jun 2, 2018
3 tasks
this.transferState.remove(makeStateKey<TransferHttpResponse>('G.' + url));
this.transferState.remove(makeStateKey<TransferHttpResponse>('H.' + url));
// TODO: Should there be an api to search for keys? or to grab all of them
Object.keys(this.transferState['store'])
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a bit dodgy, should there be a proper api to do this?

Copy link
Copy Markdown
Member

@CaerusKaru CaerusKaru left a comment

Choose a reason for hiding this comment

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

One minor nit, otherwise LGTM

const interceptor = new TransferHttpCacheInterceptor(mockAppRef(), mockTransferState());
const key1 = interceptor['makeCacheKey']('GET', 'https://google.com/api',
new HttpParams().append('a', 'bar').append('b', 'foo'));
const key2 = interceptor['makeCacheKey']('GET', 'https://google.com/api',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: indenting

@CaerusKaru CaerusKaru added PR state: LGTM state: blocked target: minor target: minor This PR is targeted for the next minor release area: common and removed action: review labels Jun 9, 2018
@CaerusKaru CaerusKaru self-assigned this Jun 9, 2018
@CaerusKaru CaerusKaru added this to the 6.0 milestone Jun 9, 2018
@Toxicable Toxicable force-pushed the fabian/cache-params branch from bfaed5e to 041d0fc Compare June 9, 2018 04:08
@Toxicable Toxicable force-pushed the fabian/cache-params branch from 041d0fc to 921ebd4 Compare June 9, 2018 04:43
@CaerusKaru CaerusKaru merged commit f09c51d into master Jun 9, 2018
@CaerusKaru CaerusKaru deleted the fabian/cache-params branch June 9, 2018 05:55
@dottodot
Copy link
Copy Markdown

Any idea when this feature will be released?

@angular-automatic-lock-bot
Copy link
Copy Markdown

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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup area: common target: minor target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants