mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2568] [CLOSED] web: the API Monitor page works when the browser refuses site storage #4133
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2568
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:chief-docs/monitor-storage📝 Commits (1)
45dcaaaweb: the API Monitor page works when the browser refuses site storage📊 Changes
2 files changed (+14 additions, -4 deletions)
View changed files
📝
serve/test_monitor.py(+8 -0)📝
serve/web/monitor.js(+6 -4)📄 Description
What it changes.
serve/web/monitor.js(the/api-monitorpage, on with"api_monitor": true) readsessionStorage(the API key) andlocalStorage(the theme) at the top of the script without atry. A browser that refuses site storage (cookies blocked for the site, or all cookies) throwsSecurityErrorthere, and the whole page stayed at "Connecting…": no polling, no request list, no Load / Unload, no theme toggle. The chat page (app.js) already catches this. The four uses now go through a smallstored(area, op, ...args)helper that ignores the error, so the page works and only does not remember the key or the theme.What it leaves alone. Everything where storage works: the same keys (
strata.monitor.keyin sessionStorage,strata.themein localStorage), the same values and defaults.app.jsandmonitor.htmlare unchanged.How it was checked.
serve.server.serve(...)test server (MockEngine,api_monitoron), with an init script that makes both storage getters throwSecurityError: before, "Connecting…" after 2.5 s and the page error "The operation is insecure."; after, "Loaded", "Live · updated …", the theme toggle works, no page error. With storage working, the same before and after.test_monitor.Monitor.test_the_page_works_without_site_storage(fails without the change);python -m unittest serve.test_monitorpasses. A sub-agent reviewer also ran the helper under Node.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.