[PR #2568] [CLOSED] web: the API Monitor page works when the browser refuses site storage #4133

Closed
opened 2026-11-07 15:33:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 45dcaaa web: 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-monitor page, on with "api_monitor": true) read sessionStorage (the API key) and localStorage (the theme) at the top of the script without a try. A browser that refuses site storage (cookies blocked for the site, or all cookies) throws SecurityError there, 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 small stored(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.key in sessionStorage, strata.theme in localStorage), the same values and defaults. app.js and monitor.html are unchanged.

How it was checked.

  • Headless Chromium (Playwright) on a serve.server.serve(...) test server (MockEngine, api_monitor on), with an init script that makes both storage getters throw SecurityError: 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.
  • New test_monitor.Monitor.test_the_page_works_without_site_storage (fails without the change); python -m unittest serve.test_monitor passes. 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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2568 **Author:** [@qiuzan2001](https://github.com/qiuzan2001) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chief-docs/monitor-storage` --- ### 📝 Commits (1) - [`45dcaaa`](https://github.com/Niko1221/Strata/commit/45dcaaaae0631b62bad998602c269eaa71b34e3b) web: the API Monitor page works when the browser refuses site storage ### 📊 Changes **2 files changed** (+14 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `serve/test_monitor.py` (+8 -0) 📝 `serve/web/monitor.js` (+6 -4) </details> ### 📄 Description **What it changes.** `serve/web/monitor.js` (the `/api-monitor` page, on with `"api_monitor": true`) read `sessionStorage` (the API key) and `localStorage` (the theme) at the top of the script without a `try`. A browser that refuses site storage (cookies blocked for the site, or all cookies) throws `SecurityError` there, 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 small `stored(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.key` in sessionStorage, `strata.theme` in localStorage), the same values and defaults. `app.js` and `monitor.html` are unchanged. **How it was checked.** - Headless Chromium (Playwright) on a `serve.server.serve(...)` test server (MockEngine, `api_monitor` on), with an init script that makes both storage getters throw `SecurityError`: 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. - New `test_monitor.Monitor.test_the_page_works_without_site_storage` (fails without the change); `python -m unittest serve.test_monitor` passes. A sub-agent reviewer also ran the helper under Node. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4133
No description provided.