Skip to content

fix: add a cache-busting query param for all HTTP calls to processor - #107

Open
equinoy wants to merge 3 commits into
mainfrom
fix/cache-busting-http-calls
Open

equinoy wants to merge 3 commits into
mainfrom
fix/cache-busting-http-calls

Conversation

@equinoy

@equinoy equinoy commented Sep 22, 2026

Copy link
Copy Markdown

Brings the cache-busting fix (58c2244, released as prerelease v1.24.1-cache-busting.1) onto main (currently v1.25.0).

Why

Newer Crestron CH5 runtimes (1.3.0.x, pulled onto DGE panels via auto-update) enabled an aggressive caching mode that serves stale responses for the app's HTTP calls to the processor — including the joinroom request — leaving panels stuck in a 1008 reconnect loop / half-loaded UI. Root-caused with A. Welker at KPMG and validated in the NYC lab; confirmed working live at The New Yorker.

What

Adds an axios request interceptor on the library's httpClient that appends a unique query param (_=<base36 timestamp><base36 random>) to every request, so each URL is unique and bypasses the aggressive cache. The extra param is ignored by the MC server. The WebSocket connection is untouched (not HTTP-cached).

Cherry-picked cleanly from 58c2244; builds clean (ES + UMD + type declarations).

Companion to the Essentials-side fix (PRs #1484 / #1485 there): Essentials cb= on the app URL forces the panel to re-download the app; this interceptor keeps the subsequent join/status calls fresh. Both halves are needed to defeat the CH5 cache.

Copilot AI lite review requested due to automatic review settings September 22, 2026 20:51
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.25.1-fix-cache-busting-http-calls.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The cache-busting interceptor must also cover the separate Axios client used by useInitialize.ts.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds cache-busting query parameters to processor HTTP requests to prevent stale responses.

Changes:

  • Adds unique timestamp/random query parameters to the middleware’s Axios requests.
  • Leaves WebSocket connections unchanged.
File Summary
src/​lib/​store/​middleware/​websocketMiddleware.ts Adds cache busting to this Axios client, but the separate /version client remains uncovered.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +21 to +28
// Add a random query parameter to every request to bust processor/browser caches
httpClient.interceptors.request.use((config) => {
config.params = {
...config.params,
_: Date.now().toString(36) + Math.random().toString(36).slice(2),
};
return config;
});
Only append the unique query param when the app URL carries the 'cb' param that Essentials adds for ForceAppRefresh touchpanels (DGE/CH5). Navigators and normal browsers see no 'cb' param, so the interceptor is a no-op and their request/caching behavior is unchanged.
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.25.1-fix-cache-busting-http-calls.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

A /system/roomCombinationChanged broadcast triggered window.location.reload(), which reloaded the panel's current deep route (e.g. /mc/app/tech). On DGE panels with forceAppRefresh this strands the app showing a blank screen until the program is restarted. Reload to the app base URL instead so routing re-runs cleanly like a fresh app push. The current query string (token / cache buster) is preserved.
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.25.1-fix-cache-busting-http-calls.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants