fix(common): skip transfer cache on client#55012
fix(common): skip transfer cache on client#55012Jefftopia wants to merge 1 commit intoangular:mainfrom
Conversation
AndrewKushnir
left a comment
There was a problem hiding this comment.
@Jefftopia thanks for creating the PR 👍
I've left a comment and also added @alan-agius4 as a reviewer to take a look at the change.
|
@Jefftopia one additional comment: I'd propose to change the commit message (via |
|
Hey @Jefftopia - Welcome :) |
6f8b48a to
6dad001
Compare
6dad001 to
f62f423
Compare
f62f423 to
f02f848
Compare
|
@Jefftopia Its usually better to push additional commits up (instead of modifying the existing commit), so that its easier to see the changes from commit to commit. |
|
@sonukapoor oh hey 👋 Missed your comment before but I won't squash everything going forward, thanks. |
|
Thanks @Jefftopia Changes LGTM. Lets's wait for Alans input. |
alan-agius4
left a comment
There was a problem hiding this comment.
Can you please amend the last 2 commits to use fixup!
IE: fixup! fix(common): skip transfer cache on client
42df598 to
a8d132a
Compare
|
done |
|
@Jefftopia thanks for updating the PR. It looks like there is still a second commit (with the "Merge branch 'main' of ..." commit message). Could you please rebase and update the branch to have just 1 commit with all changes? Thank you. |
@AndrewKushnir Edit: I went ahead and reset then rebased. Oof. |
|
@Jefftopia You could try to drop that commit and rebase again from main. |
0dbeb44 to
72a23c1
Compare
Done. |
|
Nice 👍 I usually use this git command to add a fixup commit: |
@sonukapoor Yes, I used fixup for the commits addressing but you cannot fixup a merge commit ;-) Lesson learned for me -- you can only rebase on another branch to avoid merge commits. |
|
@alan-agius4 Thanks for your patience here. After "squashing" my merge commit, hydration specs failed. The PLATFORM_ID token was resolved as an InjectionToken object rather than a string. My latest push uses EnvironmentInjector again which contains the expected value in the hydration tests. I understand the interceptor has its own injection context but would be curious to know why that is to be preferred over environment injector for
|
transfer cache interceptor should not run again on the client as it is intended for server to client handoff
222743e to
6285c78
Compare
| TestBed.configureTestingModule({ | ||
| declarations: [SomeComponent], | ||
| providers: [ | ||
| {provide: PLATFORM_ID, useValue: 'browser'}, |
There was a problem hiding this comment.
Nit: Ideally we should be using PLATFORM_BROWSER_ID instead of the browser string. Same goes for the server string in the cases below.
There was a problem hiding this comment.
Looks like this has not been addressed.
|
Bump |
alan-agius4
left a comment
There was a problem hiding this comment.
LGTM, although technically the commit scope should be http and not common.
| } | ||
|
|
||
| // Request not found in cache. Make the request and cache it. | ||
| const isServer = isPlatformServer(inject(PLATFORM_ID)); |
There was a problem hiding this comment.
NIT: We could use isPlatformBrowser here to avoid the additional symbol. (Couple of less bytes)
|
This PR was merged into the repository by commit 11705f5. |
transfer cache interceptor should not run again on the client as it is intended for server to client handoff PR Close #55012
transfer cache interceptor should not run again on the client as it is intended for server to client handoff PR Close angular#55012
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |

transfer cache interceptor should not run again on the client as it is intended for server to client handoff
PR Type
What kind of change does this PR introduce?
What is the current behavior?
In rare instances, the transfer cache interceptor may execute on the client. While this does not appear to introduce problems, it is an unnecessary step.
Issue Number: #54444
What is the new behavior?
The transfer cache interceptor no longer performs caching behavior in the 'broswer' platform.
Does this PR introduce a breaking change?