Repository navigation
fix(windows): recognize Traditional Chinese Task Scheduler states - #9160
Conversation
On zh-TW Windows, schtasks prints 就緒, 已停用 and 執行中, none of which the CSV fast path knew, so every checked-stop state read started PowerShell for the Schedule.Service fallback. Add the four zh-TW words from System32\zh-TW\schtasks.exe.mui alongside the zh-CN, ja-JP and ko-KR ones. Queued (已排入佇列) stays active, like the other locales.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request has been marked Ready for Review. Hygiene✅ Deterministic PR hygiene checks passed. |
|
@coderabbitai review |
Action performed
|
Summary
schtasks /query /fo CSV /nhreports就緒(Ready),已停用(Disabled) and執行中(Running). The CSV fast path inparseTaskCsvStateknows the zh-CN, ja-JP and ko-KR words but none of these, so on a Traditional Chinese host every task-state read falls through to the PowerShellSchedule.Serviceread. That is the PowerShell start the fast path exists to avoid within the 1 s manager-state cap ([Bug][Windows] zh-CN schtasks status makes ocx stop and ocx update fail closed inside the 1s manager-state cap #8863).System32\zh-TW\schtasks.exe.mui. Running (執行中) and Queued (已排入佇列) stay active. Ready (就緒) and Disabled (已停用) prove inactivity. The zh-CN words don't cover zh-TW because the glyphs differ (就绪/就緒,已禁用/已停用).structure/ops/windows-checked-stop.mdlists zh-TW with the other locales.Related to #8863. Same change as #8959 (ja-JP) and #8976 (ko-KR).
Verification
bun test tests/windows/windows-checked-stop-live.test.ts -t "zh-TW task state": all four new cases fail on unpatcheddev(8ef1526) withExpected: "schtasks"/Received: "powershell", and pass with this change.bun test tests/windows/windows-checked-stop-live.test.ts tests/windows/windows-checked-stop.test.ts tests/windows/windows-scheduler-install-verification.test.ts: 115 passed, 0 failed, 3 skipped (Linux, Bun 1.4.4).schtasks /query /fo CSV /nhoutput showed only three status values across 305 tasks:就緒255,已停用41,執行中9. Decoding those raw bytes withdecodeWindowsTextBytes(..., { locale: "zh-TW" })and passing each row to the patchedparseTaskCsvStateclassified all 305 rows, with nounknown.已排入佇列comes from the.muistring table because no task was queued at the time.schtasks /query /tn <task> /fo CSV /nhtook 21–42 ms and thepowershell … Schedule.Service … .Statefallback took 362–421 ms. So that fallback fit the 1 s cap on this warm host. This change removes the PowerShell start on zh-TW machines instead of fixing a failure I reproduced.bun run typecheck,bun run structure:check,bun run privacy:scanandgit diff --checkpass.bun run test:changedwas stopped after 300 s without a result (it first installed the gui dependencies). I skipped the full suite as disproportionate for a locale-word change. The focused Windows suites above cover the changed parser and the stop and install checks that call it. Cross-platform coverage remains with repository CI.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit