Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Theme builder
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 May 2025 at 12:51 UTC
Updated:
10 Jun 2025 at 17:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersI'm 95% confident this is a duplicate of #3516705: Auto-saved changes to code components are not visible in preview-on-hover-component-list until published. Can you please check if you can still reproduce this?
Comment #3
wim leersComment #4
lauriiiHow could this be a duplicate of #3516705: Auto-saved changes to code components are not visible in preview-on-hover-component-list until published if it was discovered as part of QA'ing that issue? I tested it as well on latest HEAD and confirmed that what was loaded wasn't the autosaved version but what exists in the config entity.
Comment #5
wim leersHow could anybody have known this was found by QA'ing #3516705: Auto-saved changes to code components are not visible in preview-on-hover-component-list until published if it's neither mentioned in the issue summary nor linked as a related issue? 😅
Comment #6
wim leers#2 is still true — see
\Drupal\Tests\experience_builder\Kernel\Plugin\ExperienceBuilder\ComponentSource\JsComponentTest::testGetClientSideInfo(). Doubly so because #3520052: Auto-saved changes to component are not loaded in preview canvas when component is inside a slot's test coverage is also in as of today (2814d46f805f3a0a079af0b4fe96654628eae592).That's why this is most likely a client-side invalidation bug. Either or both of:
/xb/api/v0/config/componentnot getting refetched after it changes from having no auto-save to getting an auto-save, which causes the referenced JS + CSS URLs for code components to changeiframestill being around and not re-fetching/xb/api/v0/auto-saves/js/…and/or/xb/api/v0/auto-saves/css/…Tested on
2814d46f805f3a0a079af0b4fe96654628eae592. That seems to confirm it's only the first. See attached screencast.Comment #7
bnjmnmIf I add cache busting strings to the
getCodeComponentsandgetComponentsendpoint requests, the problem goes away. The underlying problem might only be with one of the two, but that narrowed things down pretty darn quick. It looks like the BE is equipped to provide us what we need, and the FE needs to change how it asks for it.Comment #8
wim leersDo you mean: a query string that includes the current time? Does that mean you're saying you're getting a cached response from the server side? If so: then this would actually be a server-side bug (cache tags, baby!).
Which … makes me actually jump to thinking this is just a duplicate of #3522217: JsComponent-sourced rendered component instances lack cacheability of underlying config entities (+ first-party imports + auto-save tag when previewing) 😬 And I wouldn't have spotted that because I'm testing with
settings.local.phpcontaining🙈
@mayur-sose Can you test this again with #3522217 applied? 🙏
Comment #9
mayur-sose commented@wim-leers, I am still able to reproduce both the issues.
Comment #10
mayur-sose commentedComment #11
balintbrews#9 shows #3508937: Global AssetLibrary should render with its auto-saved state (if any) when rendered in the XB UI — now that we landed #3516390: Compile Tailwind CSS globally for code components. More context: We switched from saving the compiled Tailwind CSS in individual code components to saving it in the global asset library. This is the first time we're actually using the global asset library for assets that are needed for rendering, so it surfaced the need for #3508937: Global AssetLibrary should render with its auto-saved state (if any) when rendered in the XB UI.
→ Let's not use Tailwind CSS for testing this issue to identify clear boundaries of what we're trying to fix.
Here is an example code component for testing:
JavaScript:
CSS — NOT global CSS:
Comment #13
balintbrewsI did some investigation, turns out we were missing some needed client-side invalidation — see MR —, but that is not fixing all the issues. The preview thumbnail can still show stale data. I tried it on top of #3522217: JsComponent-sourced rendered component instances lack cacheability of underlying config entities (+ first-party imports + auto-save tag when previewing), and that didn't help. I recorded a video, I'll post it shortly.
Comment #14
balintbrewsComment #15
wim leersEven if #13 says #3522217: JsComponent-sourced rendered component instances lack cacheability of underlying config entities (+ first-party imports + auto-save tag when previewing) didn't fix it (and perhaps that's due to a bug I spotted in the current MR, perhaps not), #3522217 should land first because otherwise it wouldn't be clear how to debug/reason about this issue.
Comment #16
wim leersRealization while running, will verify in code tomorrow: this might be caused by the global asset library (auto-saved or not) not being an asset library dependency _yet_ of every code component’s asset library.
Comment #17
balintbrews#16: The global asset library is not in play here if we follow what I suggested in #11.
Comment #18
wim leers#3522217: JsComponent-sourced rendered component instances lack cacheability of underlying config entities (+ first-party imports + auto-save tag when previewing) is in!
Comment #19
balintbrews#3522217: JsComponent-sourced rendered component instances lack cacheability of underlying config entities (+ first-party imports + auto-save tag when previewing) did fix the backend problem! 🎉
Two tiny bits need to go in on the frontend, and we should be good!
I marked #3525374: Include compiled CSS from global asset library when displaying component library preview thumbnails postponed on this issue, so it's cleaner to tackle.
Comment #20
balintbrewsComment #21
wim leers#19: glad to hear #3522217 did fix it after all :) I was kinda losing my sanity with your prior observations that it wasn't 😄 But that's because there were still some bugs in there that I fortunately caught prior to merging.
#3525374: Include compiled CSS from global asset library when displaying component library preview thumbnails was 2 LoC that you confirmed to be working yesterday, most of the work was expanding test coverage 🤓 That's already in now 👍
This is tagged , but I don't see any, and it does seem disproportionate to the JS changes. 👍 Removing.
I'd be confident merging this based on the tag invalidation alone, but I do not know enough about the
refetchOnMountOrArgChangebit, so leaving in .Comment #24
hooroomoo🎉