fix: always fetch live API data in server mode#92
Open
Kampe wants to merge 1 commit intocalesthio:masterfrom
Open
fix: always fetch live API data in server mode#92Kampe wants to merge 1 commit intocalesthio:masterfrom
Kampe wants to merge 1 commit intocalesthio:masterfrom
Conversation
When running in Docker/Kubernetes, the dashboard serves baked-in data from the Docker image build time instead of fetching live data from the API. This is because the DOMContentLoaded handler checks `canProbeApi && !hasInlineData` — but the inline data `D` variable is always populated from the build, so `hasInlineData` is always true and the API fetch is never executed. The fix changes the condition to just `canProbeApi`, so the dashboard always fetches from `/api/data` when running on a server (HTTP/HTTPS), regardless of whether inline data exists. File mode (opened as a local file) still uses inline data as a fallback. This caused the dashboard to show data from whenever the Docker image was built, not live intelligence data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running Crucix in Docker/Kubernetes, the dashboard shows stale data from the Docker image build time instead of live intelligence data.
The
DOMContentLoadedhandler injarvis.htmlchecks:But the inline data variable
Dis always populated at build time (line 375), sohasInlineDatais alwaystrueand the/api/datafetch is never executed. The dashboard renders the baked-in snapshot forever.Fix
Change the condition to just
canProbeApi:This makes the dashboard always fetch from
/api/datawhen running on a server (HTTP/HTTPS). File mode (local HTML file) still uses inline data as fallback sincecanProbeApiisfalseforfile://protocol.Impact
connectSSE()call in the fetch handler ensures live updates continue after initial load🤖 Generated with Claude Code