Skip to content

fix(windows): gate active-theme writes with a short update marker - #291

Open
starsstreaming wants to merge 2 commits into
Fei-Away:mainfrom
starsstreaming:feat/atomic-theme-writes
Open

fix(windows): gate active-theme writes with a short update marker#291
starsstreaming wants to merge 2 commits into
Fei-Away:mainfrom
starsstreaming:feat/atomic-theme-writes

Conversation

@starsstreaming

Copy link
Copy Markdown

Summary / 摘要

Stacked on #290 (feat/video-backgrounds).

Gate Windows active-theme commits with a short-lived .theme-update-in-progress marker so the injector watcher cannot load a mixed image/video/json/css stamp mid-write. Large files are prepared first; the marker covers only the final commit window and is cleared on success. Stale markers expire so a crashed writer cannot freeze theme loads forever.

叠在 #290 之上。Windows 活动主题提交增加短窗口 .theme-update-in-progress 标记,避免观察者读到半套文件;大文件先备妥,标记只罩最终提交瞬间,成功后清除;过期标记不永久卡住加载。

Depends on / 依赖: #290 — please merge that first (or merge this only after #290). Base branch for review: starsstreaming:feat/video-backgrounds.

Type / 类型

  • Bug fix / 缺陷修复
  • Feature / 新功能
  • Docs / 文档
  • Theme / CSS / visual / 主题或视觉
  • Scripts / install / restore / 脚本或安装恢复
  • Chore / 杂项

Platform / 平台

  • macOS
  • Windows
  • Both / 双平台
  • Docs / repo only / 仅文档或仓库元数据

Self-check / 自测

Windows

  • Relevant scripts / tests exercised / 已跑相关脚本与测试
  • Environment noted below / 下方注明环境

User-facing

  • Updated windows/CHANGELOG.md under ## 未发布 (no VERSION bump)

Security / 安全

  • Does not modify official Codex install / asar / signatures
  • Does not silently write API Base URL or keys
  • CDP remains loopback-oriented (127.0.0.1)

Notes / 补充

Behavior

  • Set-DreamSkinActiveTheme writes marker token around final moves of image/video + theme.json / css
  • loadTheme rejects while marker is fresh; end-of-load also fails if marker appears mid-read
  • Watcher waits for commit on startup; audit loop skips reload while themeUpdatePending
  • Stale marker (>120s) ignored

Checks

  • node --test windows/tests/injector-bootstrap.test.mjs — pass
  • Stack tip also covered by full windows/tests/run-tests.ps1 on the next PR (verified rollback) — exit 0
  • git diff --check clean on commit

Stack

  1. feat(runtime): add cross-platform MP4 video backgrounds #290 video backgrounds ← base
  2. this PR atomic theme write marker
  3. verified tray rollback (next)
  4. CSS narrow native surfaces (last)

Environment

  • Windows 11 Pro 10.0.26200
  • Branch: starsstreaming:feat/atomic-theme-writes @ 7702162

Support optional theme.json video fields, loopback media serving,
menu/tray import, poster fallback, and renderer handoff on both
platforms. Closes Fei-Away#240.
Write .theme-update-in-progress only around the final image/video/json/css
commit so the watcher cannot load a mixed stamp, then clear it on success.
Stale markers expire so a crashed writer cannot freeze theme loads forever.
@starsstreaming

Copy link
Copy Markdown
Author

Stack: depends on #290. Next: #292#293.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant