Closed (duplicate)
Project:
JSON:API
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
24 Jan 2019 at 03:41 UTC
Updated:
7 Feb 2019 at 14:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
effulgentsia commentedI'm curious which tests, if any, will fail with this.
Comment #4
effulgentsia commentedHm, so the answer seems to do with page cache expectations. See:
Something about this feels off, but I'm not exactly sure what yet. I'll come back and comment here when I have something useful to say about it.
Comment #5
effulgentsia commentedNow that I thought about it some more, I agree with it. But, I'd like to add code comments to explain it to future people who wonder the same.
Comment #6
effulgentsia commentedI haven't gotten to this yet, but in the meantime I opened #3028501: Enable header-based proactive content negotiation with optimizations and opt-outs available. as a core issue.
Comment #7
wim leersComment #8
effulgentsia commentedIdeally, I'd like for #3029373: PageCache::getCacheId() sometimes uses different cache IDs during get and set, causing unnecessary cache misses for some requests to land in core, and then for us to remove the FormatSetter middleware. See #3028501-5: Enable header-based proactive content negotiation with optimizations and opt-outs available..1 for the pitfalls of varying by Accept header.
Comment #9
wim leersOh, that sounds lovely! 👏 I think we'd all love to remove this middleware!
I fixed the test failures over at #3029373-6: PageCache::getCacheId() sometimes uses different cache IDs during get and set, causing unnecessary cache misses for some requests.
With both that core patch applied and the JSON:API patch that I attached here, tests are mostly passing:
So it looks like this will be viable :)
Comment #10
wim leersI dug in and that failing test is legitimate. Some error responses happen before or during routing, and at that time the JSON:API format hasn't been negotiated yet. So … you get a HTML response.
This may be acceptable.
Comment #11
effulgentsia commentedWell, let's fix that :) How's this?
Comment #12
effulgentsia commentedOops. Forgot to include a local change that I had in the #11 patch. Here it is.
Comment #13
wim leers#3029373: PageCache::getCacheId() sometimes uses different cache IDs during get and set, causing unnecessary cache misses for some requests just landed! Retesting.
Comment #14
wim leersOh, right, this can never be committed to JSON:API 2.x since it must work for 8.5+8.6+8.7. If we're lucky, we could get #3029373: PageCache::getCacheId() sometimes uses different cache IDs during get and set, causing unnecessary cache misses for some requests backported to 8.6. But it'll never get backported to 8.5.
So, we can only do this as part of #3015325: [ignore] support issue for the core patch AFAICT.
Comment #18
wim leersFor the reasons given in #14, this passed tests on 8.7, but not on 8.5 or 8.6.
Thoughts?
Comment #19
effulgentsia commentedI agree we should move this to #3015325: [ignore] support issue for the core patch
Comment #20
effulgentsia commentedComment #21
wim leers#19: done: #3015325-31: [ignore] support issue for the core patch.