Skip to content

Fix/restore upgrade runtime sync - #54

Merged
duguwanglong merged 12 commits into
mainfrom
fix/restore-upgrade-runtime-sync
Apr 9, 2026
Merged

duguwanglong merged 12 commits into
mainfrom
fix/restore-upgrade-runtime-sync

Conversation

@xiami762

@xiami762 xiami762 commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR restores reliable upgrade / restart-runtime behavior on Windows, hardens the installer and updater UX around Node/npm failures and strict PowerShell modes, improves China-region install and upgrade paths (mirrors and dedicated bootstrap entrypoints), and fixes Docker WebUI env handling plus UpdateModal progress reporting.

Motivation

  • Upgrades could break or confuse users when restart-runtime validation failed, temp paths used Windows 8.3 short names, or Vite/path.relative disagreed with resolved long paths.
  • Installers needed clearer failure hints, safer streaming of external command output under strict ErrorActionPreference, and optional China mirrors for faster, more reliable bootstrap and upgrades.

Changes

Updater & runtime (Windows)

  • Restore upgrade restart-runtime handling after regressions around upgrade flow.
  • Resolve Windows 8.3 temp paths before using them as subprocess cwd (avoids Node/Vite path.relative mismatches vs long resolved paths).
  • Harden Windows runtime validation: retry import checks after uv sync (timeouts/delays), surface UpdateProgress errors instead of hard-failing on restart argv/exec issues.
  • Stream long-running install output (bash tee, PowerShell -StreamOutput).
  • Vite: use realpathSync.native for project root to avoid Windows short-path issues.
  • Tests: expanded coverage for validation retries and graceful error paths.

Installers (bash / PowerShell)

  • Preserve ErrorActionPreference during StreamOutput native runs (temporarily Continue, restore in finally).
  • Manual Node.js download hint: FLOCKS_NODEJS_MANUAL_DOWNLOAD_URL (EN default; zh wrappers point at zh-cn page); appended on Node/npm/npx-related failures; tests updated.
  • China bootstrap: dedicated install_zh entrypoints and docs (Gitee + domestic mirrors by default); default installers use configured registries with probe helpers.
  • English bootstrap copy for root install.ps1 / install.sh, registry URL variables, aligned process-cleanup test strings.
  • Zh Chrome for Testing: default to China mirror for faster browser setup in zh installers.

Updater (China / zh)

  • Route zh locale or explicit CN region upgrades through Gitee and domestic npm/PyPI mirrors; align China bootstrap/update archive layout with working Gitee refs/tags zip format.

xiami762 added 2 commits April 5, 2026 20:45
- Stop passing localhost VITE_API_BASE_URL / VITE_WS_BASE_URL in docker-publish so production images rely on runtime configuration.

- Update UpdateModal apply progress in place per stage to avoid duplicate step rows during upgrade.

Made-with: Cursor
@xiami762
xiami762 requested a review from duguwanglong April 7, 2026 02:52
xiami762 and others added 10 commits April 8, 2026 10:36
- Translate root bootstrap install.ps1/install.sh user messages to English
- Add PyPI/npm registry variables and URL probe helpers in workspace installers
- Align process-cleanup tests with English lock-retry step descriptions
- Restore newline at EOF on bootstrap scripts

Made-with: Cursor
Provide dedicated install_zh entrypoints and docs so users in China can install from Gitee with default domestic mirrors. Also simplify the default installers to use configured registries directly and cover the new PowerShell encoding rules in CI.

Made-with: Cursor
Prefer Gitee and domestic npm/PyPI mirrors for zh locale or explicit cn region upgrades, and align China bootstrap/update archives with the working Gitee refs/tags zip format.

Made-with: Cursor
Default zh installers to the China Chrome for Testing mirror so browser setup is faster without changing the existing install flow.

Made-with: Cursor
- Retry Windows restart-runtime import check after uv sync (timeout, delays)
- Yield UpdateProgress errors instead of raising on restart argv/exec failures
- Stream long-running install output via tee (bash) and -StreamOutput (PS1)
- Vite: use realpathSync.native root to avoid Windows 8.3 path.relative bugs
- Expand updater tests for validation retries and graceful error paths

Made-with: Cursor
Set Continue only while streaming external command output so strict
modes do not abort the pipeline; restore previous preference in finally.

Made-with: Cursor
tempfile.mkdtemp may return short paths under long profile dirs; using them
as subprocess cwd breaks Node/Vite path.relative vs long resolved paths.

Made-with: Cursor
- Add FLOCKS_NODEJS_MANUAL_DOWNLOAD_URL with en default; zh wrappers set zh-cn page
- Bash/PowerShell installers append hint to all Node/npm/npx-related failures
- Extend install script source tests for new env var and helpers

Made-with: Cursor
Align the process cleanup test with the current installer behavior by removing assertions for source probing helpers that no longer exist.

Made-with: Cursor
@duguwanglong
duguwanglong merged commit b3a0d3e into main Apr 9, 2026
2 checks passed
@xiami762
xiami762 deleted the fix/restore-upgrade-runtime-sync branch May 20, 2026 00:39
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.

2 participants