Repository navigation
Fix dashboard module wiring and add frontend smoke/link checks - #921
Open
shadow-ghost706 wants to merge 4 commits into
Open
shadow-ghost706 wants to merge 4 commits into
shadow-ghost706 wants to merge 4 commits into
Conversation
…Y_NAME`, `KEY_SAVE Closes StellarGateLabs#863
…PI-key storage des Closes StellarGateLabs#864
… `static/dom.js` a Closes StellarGateLabs#865
…o load — add a bro Closes StellarGateLabs#866
|
@shadow-ghost706 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Fix dashboard module wiring and add frontend smoke/link checks
What was solved
#863 —
static/session.jsreferences undefinedKEY_NAME,KEY_SAVED_AT,safeGet,safeSet,safeRemoveandmemoryStorageFix
static/session.jsby defining the missing constants (KEY_NAME,KEY_SAVED_AT), storage helpers (safeGet/safeSet/safeRemove), and aMap-backedmemoryStorage()fallback, exportingKEY_NAMEfor tests. Then updatestatic/dashboard.jsto importKEY_NAME/KEY_SAVED_ATfromsession.jsinstead of redeclaring them, establishing a single source of truth.Addressed:
KEY_NAMEandKEY_SAVED_ATconstants instatic/session.jsand exportKEY_NAMEasstatic/tests/session.test.jsexpectssafeGet/safeSet/safeRemovehelpers with try/catch aroundgetItem/setItem/removeItemMap-backedmemoryStorage()fallback used whenopts.session/opts.localis absent#864 —
static/session.jscontains two competing API-key storage designs — pick one and delete the otherRemove the dead in-memory API-key storage (
getStoredKey/storeKey/storedKey/storedKeyExpiresAt) fromstatic/session.jsso the module exports exactly one storage mechanism — the existingcreateSessionStore(sessionStorage by default, localStorage only with explicit "remember me" plus TTL). Update the README dashboard security section to state the storage policy (where, how long, how to clear), and align theno-key-leak.spec.jse2e test with that policy (nothing in localStorage without "remember me").Addressed:
static/session.jsmust export exactly one storage mechanism: keepcreateSessionStoreand delete the unused module-level in-memorygetStoredKey/storeKeyimplementation (and itsstoredKey/storedKeyExpiresAtstate).createSessionStore's behaviour (sessionStorage default, localStorage only with remember-me, saved-at timestamp, expiry on read) — it is the chosen design and is used bydashboard.js.#865 — Orphaned dashboard modules:
static/api.js,static/dom.jsandstatic/dashboard-format.jsare never served or importedAdopt the orphaned
static/api.jsandstatic/dom.jsmodules by serving them fromsrc/api/mod.rs(include_str! + routes), importing them fromdashboard.jsin place of the inlineel()/setTexthelpers and inlinefetchwrapper, and delete the unusedstatic/dashboard-format.jsshim. Add an asset test intests/dashboard_asset_tests.rsenforcing that everystatic/*.js(excludingstatic/tests/) is served, so orphans can't accumulate again.Addressed:
static/api.jsandstatic/dom.jsviainclude_str!plus routes insrc/api/mod.rs, matching the existing pattern used for other static modulesstatic/dashboard.jsimportrequest/API helpers fromapi.jsand$/el/show/clear/setErrorfromdom.js, removing the inline duplicate helpers and inline fetch wrapperstatic/dashboard-format.js(shim with no consumer)#866 — Dashboard CI can't catch a page that fails to load — add a browser smoke test that doesn't depend on the Rust build
Add a Rust-independent dashboard browser smoke test plus a static module-graph link check so CI catches frontend breakage (missing exports, undefined identifiers) even when the Rust build is broken. The smoke test serves static/ with the gateway path layout, stubs /v1/* with fixtures, loads /dashboard in Chromium, fails on any pageerror/console.error, signs in with a fixture key, and asserts the payments table renders a row. A separate no-browser script parses import { … } from './x.js' across static/ and verifies names against each module's exports.
Addressed:
Changes
README.md(modify)e2e/tests/dashboard.spec.js(modify)static/session.js(modify).github/workflows/dashboard.yml(modify)scripts/check-dashboard-a11y.mjs(modify)e2e/tests/no-key-leak.spec.js(modify)e2e/scripts/serve.mjs(modify)Approach
static/session.jsreferences undefinedKEY_NAME,KEY_SAVED_AT,safeGet,safeSet,safeRemoveandmemoryStorage#863 —static/session.jsreferences undefinedKEY_NAME,KEY_SAVED_AT,safeGet,safeSet,safeRemoveandmemoryStorage(Changed: static/session.js, static/session.js)static/session.jscontains two competing API-key storage designs — pick one and delete the other #864 —static/session.jscontains two competing API-key storage designs — pick one and delete the other (Changed: e2e/tests/no-key-leak.spec.js)static/api.js,static/dom.jsandstatic/dashboard-format.jsare never served or imported #865 — Orphaned dashboard modules:static/api.js,static/dom.jsandstatic/dashboard-format.jsare never served or imported (Changed: README.md)Issues
Closes #863
Closes #864
Closes #865
Closes #866