What went wrong
The appearance tab embeds the cover preview with [isNeedToRefreshColors]="true" and [previewBranding]="coverPreviewBranding". That getter built a new object on every change-detection cycle, even when the colors had not changed.
The preview treated a new object as a color change. It rebuilt sections and started import() for every missing layout. The generation token incremented at the start of each load, so the previous Promise.all was stale and never wrote the cache. PendingTasks.done() then scheduled another cycle. The cache stayed empty. The next cycle started the imports again.
Public / and /athletes pass sections once. They do not have this getter. That is why the leak showed up here and not on the marketing walk.
Commit 7309f6bd50: stop reloading layouts every cycle
What changed
coverPreviewBrandingkeeps the last object when the color, logo, and text fields are the same. Angular then sees a stable input.- The preview only treats branding as changed when those field values change, not when the object identity changes.
- A resolve with the same layout list and page colors used to skip the data copy. That hid published heading and image updates on white-label home. A later commit rebuilds when the
sectionsinput changes. - Overlapping loads wait on one in-flight
Promise.all. The generation token still drops a load after destroy. It no longer increments at the start of every resolve.
A real color edit still rebuilds. Switching desktop and mobile still rebuilds inputs. Destroy still aborts. What died is the empty-cache spin.
Commit 8dda6fb483: keep published copy updates, and do not load after destroy
Astra's review of this PR was right about two things. The resolve key does not include section payload. White-label home shows the cached cover, then refreshPublishedCoverPage swaps coverPageData. Same layout list meant the new headlines stayed off the screen. The waiter after an in-flight load could also start another import() after destroy.
- When the
sectionsinput changes,resolveSectionsOncealways copiesitem.dataagain. Cached layout classes stay. The import gate is unchanged. - A destroyed flag is checked before the await, after the await, and before
markForCheck.
How I would check it
Use a creator account on its white-label site. Do not publish. Chrome task manager is the memory check.
| Check | What I expect |
|---|---|
Open /edit-preference/whitelabel, cover preview tab, wait a minute |
Tab memory stays near the pre-10849 tab, hundreds of MB, not multiple GB. CPU settles. |
| Change a palette color | The embed still recolors. It does not reload the same layout files in a loop. |
Public /, /athletes, comparison |
Same sections as before. Unused layouts still off the wire. This PR does not undo 10849. |
Verification checklist
Keep Chrome task manager open next to the tab. Do not publish. Checks are saved in this browser.