Pages with includes are cached without (default) included referenced content

Created on 22 November 2023, 12 months ago
Updated 12 July 2024, 4 months ago

Problem/Motivation

JSON:API enpoints seem to be cached without the included references, once the page is manually saved the references will be included.

Steps to reproduce

  1. Create an endpoint with a default include
  2. Maken sure Drupal cache is enabled
  3. Clear the cache (drush cr)
  4. Request the created endpoint (i.e. /jsonapi/node/page/123e4eb4-7f24-4ede-9b76-6fe943dbe3db) and notice the missing includes
  5. Request the endpoint with an extra query parameter (i.e. /jsonapi/node/page/123e4eb4-7f24-4ede-9b76-6fe943dbe3db?resourceVersion=rel:latest-version) and notice all includes are there
  6. Save the entity for which the endpoint was requested (drush entity:save node NID)
  7. Request the first endpoint again and notice the included references are now there as expected with or without the extra parameter.
🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇳🇱Netherlands markwittens

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @markwittens
  • Pipeline finished with Failed
    5 months ago
    Total: 356s
    #193118
  • Pipeline finished with Failed
    5 months ago
    Total: 274s
    #193128
  • Pipeline finished with Success
    5 months ago
    Total: 296s
    #193130
  • Pipeline finished with Failed
    5 months ago
    Total: 281s
    #193135
  • Pipeline finished with Failed
    5 months ago
    Total: 197s
    #206954
  • Pipeline finished with Failed
    5 months ago
    Total: 143s
    #206964
  • Pipeline finished with Canceled
    5 months ago
    Total: 117s
    #206973
  • Pipeline finished with Failed
    5 months ago
    Total: 174s
    #206974
  • Pipeline finished with Canceled
    5 months ago
    #206980
  • Pipeline finished with Failed
    5 months ago
    #206981
  • Pipeline finished with Failed
    5 months ago
    Total: 170s
    #206999
  • Pipeline finished with Success
    5 months ago
    Total: 269s
    #207214
  • I am having a similar issue, though with different steps to reproduce.

    Steps to reproduce

    1. Create an endpoint with a default include
    2. Make sure Drupal cache is enabled
    3. Clear the cache (and ensure max-age on cache on below requests has also expired)
    4. Request the created endpoint without any includes eg /jsonapi/node/page?include=
    5. Request the created endpoint as default eg /jsonapi/node/page and see that it is serving the response without includes from previous step

    This issue seems to have been introduced with 🐛 Pages with default includes are not cached Fixed in v3.25. If I roll back to 3.24 the issue is not present.

  • 🇳🇱Netherlands bbrala Netherlands

    Ok, so what i understand.

    /jsonapi/node/page?include=: A page with includes cleared.

    is cached the same as

    /jsonapi/node/page: A page with default includes.

    That indeed seems like a regression. We should able to test that pretty easily in this test somewhere:

    JsonApiDefaultsFunctionalTest

  • Pipeline finished with Failed
    4 months ago
    Total: 249s
    #221478
  • Pipeline finished with Failed
    4 months ago
    Total: 271s
    #221482
  • 🇳🇱Netherlands bbrala Netherlands

    Tried to reproduce in tests, couldn't reproduce the first case (IS) but seems i can reproduce the second case by @cb_dewr.

  • Pipeline finished with Failed
    4 months ago
    Total: 313s
    #221496
  • Pipeline finished with Success
    4 months ago
    Total: 245s
    #221919
  • Pipeline finished with Success
    4 months ago
    Total: 2689s
    #222267
  • Pipeline finished with Canceled
    4 months ago
    Total: 143s
    #222492
  • Status changed to Needs review 4 months ago
  • 🇳🇱Netherlands bbrala Netherlands

    I think this is fixed now. Problem was indeed the difference of `include=` versus no include paramter at all. I would love a review on this, perhaps test this patch on your site.

  • Pipeline finished with Failed
    4 months ago
    Total: 311s
    #222495
  • Pipeline finished with Success
    4 months ago
    Total: 238s
    #222501
  • Pipeline finished with Failed
    4 months ago
    Total: 308s
    #225753
  • Pipeline finished with Failed
    4 months ago
    Total: 331s
    #225756
  • Pipeline finished with Failed
    4 months ago
    #225761
  • Pipeline finished with Failed
    4 months ago
    Total: 292s
    #226399
  • Pipeline finished with Failed
    4 months ago
    #229847
  • Pipeline finished with Canceled
    4 months ago
    Total: 84s
    #229850
  • Pipeline finished with Failed
    4 months ago
    Total: 301s
    #229851
  • Pipeline finished with Canceled
    4 months ago
    Total: 312s
    #229855
  • Pipeline finished with Success
    4 months ago
    Total: 280s
    #229856
  • Pipeline finished with Success
    4 months ago
    Total: 294s
    #229860
  • Pipeline finished with Success
    4 months ago
    Total: 445s
    #229956
  • Pipeline finished with Success
    4 months ago
    Total: 294s
    #229961
  • Pipeline finished with Failed
    4 months ago
    Total: 303s
    #230031
  • Pipeline finished with Success
    4 months ago
    Total: 382s
    #230035
  • Pipeline finished with Success
    4 months ago
    Total: 281s
    #230039
  • Pipeline finished with Success
    4 months ago
    Total: 188s
    #230062
  • Pipeline finished with Skipped
    4 months ago
    #233418
  • Pipeline finished with Success
    3 months ago
    Total: 77s
    #246233
  • Pipeline finished with Success
    3 months ago
    Total: 81s
    #246239
  • Pipeline finished with Failed
    3 months ago
    #247411
  • Pipeline finished with Success
    3 months ago
    Total: 475s
    #249354
  • Pipeline finished with Success
    3 months ago
    Total: 474s
    #254102
  • Pipeline finished with Success
    3 months ago
    Total: 467s
    #255101
  • Pipeline finished with Success
    3 months ago
    Total: 467s
    #255109
  • Pipeline finished with Success
    3 months ago
    Total: 442s
    #257411
  • Pipeline finished with Failed
    3 months ago
    Total: 201s
    #260481
  • Pipeline finished with Success
    3 months ago
    #261007
  • Pipeline finished with Failed
    3 months ago
    #261019
  • Pipeline finished with Success
    3 months ago
    Total: 189s
    #261020
  • Pipeline finished with Success
    3 months ago
    Total: 207s
    #261870
  • Pipeline finished with Canceled
    3 months ago
    Total: 83s
    #267333
  • Pipeline finished with Failed
    3 months ago
    Total: 157s
    #267334
  • Pipeline finished with Success
    3 months ago
    Total: 649s
    #268348
  • Pipeline finished with Failed
    3 months ago
    #268528
  • Pipeline finished with Skipped
    3 months ago
    #269717
  • Pipeline finished with Failed
    3 months ago
    Total: 268s
    #270305
  • Pipeline finished with Failed
    3 months ago
    Total: 547s
    #270313
  • Pipeline finished with Success
    3 months ago
    Total: 328s
    #270349
  • Pipeline finished with Skipped
    3 months ago
    #270451
  • Pipeline finished with Success
    2 months ago
    #271798
  • Pipeline finished with Success
    2 months ago
    Total: 273s
    #271801
  • Pipeline finished with Failed
    2 months ago
    Total: 152s
    #272195
  • Pipeline finished with Success
    2 months ago
    Total: 1117s
    #276815
  • Pipeline finished with Success
    2 months ago
    Total: 392s
    #276823
  • Pipeline finished with Failed
    2 months ago
    #276986
  • Pipeline finished with Failed
    2 months ago
    Total: 284s
    #277005
  • Pipeline finished with Failed
    2 months ago
    #277011
  • Pipeline finished with Success
    2 months ago
    Total: 191s
    #278801
  • Pipeline finished with Failed
    2 months ago
    Total: 255s
    #279859
  • Pipeline finished with Success
    2 months ago
    Total: 347s
    #279865
  • Pipeline finished with Success
    2 months ago
    Total: 421s
    #280442
  • Pipeline finished with Success
    2 months ago
    Total: 211s
    #280446
  • Pipeline finished with Success
    2 months ago
    Total: 218s
    #280983
  • Pipeline finished with Success
    2 months ago
    Total: 229s
    #282178
  • Pipeline finished with Success
    2 months ago
    Total: 230s
    #282277
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 49s
    #293018
  • Pipeline finished with Failed
    about 2 months ago
    Total: 509s
    #293040
  • Pipeline finished with Failed
    about 2 months ago
    Total: 217s
    #293209
  • Pipeline finished with Failed
    about 2 months ago
    Total: 221s
    #293364
  • Pipeline finished with Failed
    about 2 months ago
    Total: 242s
    #298054
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 141s
    #298070
  • Pipeline finished with Failed
    about 2 months ago
    Total: 251s
    #298071
  • Pipeline finished with Success
    about 1 month ago
    #306146
  • Pipeline finished with Success
    10 days ago
    Total: 881s
    #330396
  • Pipeline finished with Success
    10 days ago
    Total: 392s
    #330574
Production build 0.71.5 2024