From 079ee9d147b465fd8dc3ca42f78620757d8a7eaa Mon Sep 17 00:00:00 2001 From: Nines AI SRE Date: Wed, 17 Jun 2026 14:49:43 +0000 Subject: [PATCH 1/2] fix(schedule-editor): invalidate manifest cache after save Deleted custom fields (additional_fields) reappeared after saving because ManifestStore cached the pre-save manifest indefinitely. On re-mount the stale cache was served, and buildInternalProps fell through to it when the prop wasn't set by the parent. - Export invalidateManifestCache() from the manifest store - Call it after saveManifest() in the schedule editor - Also update the local manifest variable for in-session consistency Fixes CUST-5442 --- commons/src/store/manifest.ts | 15 +++++++++++++++ .../schedule-editor/src/ScheduleEditor.svelte | 11 +++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/commons/src/store/manifest.ts b/commons/src/store/manifest.ts index 8eaf6827..c2d2a990 100644 --- a/commons/src/store/manifest.ts +++ b/commons/src/store/manifest.ts @@ -36,3 +36,18 @@ function initialize(): Writable { } export const ManifestStore = initialize(); + +/** + * Invalidate a cached manifest entry so the next access triggers a fresh fetch. + * Call after saving a manifest to prevent stale data on re-mount. + */ +export function invalidateManifestCache(componentId: string, accessToken?: string): void { + const key = JSON.stringify({ component_id: componentId, access_token: accessToken }); + ManifestStore.update((store) => { + // The store wraps a Proxy whose underlying target holds cached promises. + // Deleting the key from the store object causes the Proxy get-trap to + // re-fetch on the next access. + delete (store as Record)[key]; + return store; + }); +} diff --git a/components/schedule-editor/src/ScheduleEditor.svelte b/components/schedule-editor/src/ScheduleEditor.svelte index b904fad8..53901aab 100644 --- a/components/schedule-editor/src/ScheduleEditor.svelte +++ b/components/schedule-editor/src/ScheduleEditor.svelte @@ -20,6 +20,7 @@ import { onDestroy, onMount, tick } from "svelte"; import timezones from "timezones-list"; import { ErrorStore, ManifestStore } from "@commons"; + import { invalidateManifestCache } from "@commons/store/manifest"; import { getEventDispatcher } from "@commons/methods/component"; import { saveManifest } from "@commons/connections/manifest"; import "../../availability/src/Availability.svelte"; @@ -201,7 +202,7 @@ } // #endregion mount and prop initialization - function saveProperties() { + async function saveProperties() { const cleanedProps = { ..._this, custom_fields: _this.custom_fields.map((field) => { @@ -210,7 +211,13 @@ }), }; - saveManifest(id, cleanedProps, access_token); + await saveManifest(id, cleanedProps, access_token); + + // Invalidate the ManifestStore cache and update the local manifest so + // that both re-mounts and in-session reads reflect the saved state. + // Fixes CUST-5442: deleted custom fields reappearing after save. + invalidateManifestCache(id, access_token); + manifest = { ...cleanedProps }; } // #region unpersisted variables From 23e887d9769d6d32293ce756d0b79a0f242e95d0 Mon Sep 17 00:00:00 2001 From: maithri471 Date: Wed, 17 Jun 2026 14:04:21 -0400 Subject: [PATCH 2/2] ci: bump actions/cache v2 -> v4 to fix hard-failing build GitHub now auto-fails any workflow run that references the deprecated actions/cache@v2 (toolkit cache package shutdown). This failed the `build` job during job setup, before any code ran, which gated lint/type-check/test-unit (all skipped) and the Vercel deploys. Bumps all 8 actions/cache refs in build-test-publish.yaml to v4. No code changes; unblocks CI for this PR and the repo as a whole. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/build-test-publish.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-test-publish.yaml b/.github/workflows/build-test-publish.yaml index d2b2c9a5..ae5dc68b 100644 --- a/.github/workflows/build-test-publish.yaml +++ b/.github/workflows/build-test-publish.yaml @@ -48,7 +48,7 @@ jobs: run: yarn build - name: Cache build - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: cache-build id: cache-build @@ -56,7 +56,7 @@ jobs: path: ./* key: ${{ github.sha }} - name: Cache cypress - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: cache-cypress id: cache-cypress @@ -75,7 +75,7 @@ jobs: with: node-version: 14 - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: restore-build with: path: ./* @@ -94,7 +94,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: "14" - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: restore-build with: path: ./* @@ -112,7 +112,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: "14" - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: restore-build with: path: ./* @@ -128,12 +128,12 @@ jobs: containers: [1, 2, 3, 4, 5, 6, 7] needs: ["build", "prepare"] steps: - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: restore-build with: path: ./* key: ${{ github.sha }} - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: restore-cypress with: path: /home/runner/.cache/Cypress/* @@ -168,7 +168,7 @@ jobs: node-version: 14 registry-url: "https://registry.yarnpkg.com/" - - uses: actions/cache@v2 + - uses: actions/cache@v4 id: restore-build with: path: ./*