Skip to content

fix(progress): ProgressHandle.setTotal + 首帧/非TTY DRY(#68 后) - #70

Merged
Tanya7z merged 1 commit into
mainfrom
cursor/bc-8ef3ffe9-d651-445a-848a-ef433640bd8d-211c
Jul 24, 2026
Merged

fix(progress): ProgressHandle.setTotal + 首帧/非TTY DRY(#68 后)#70
Tanya7z merged 1 commit into
mainfrom
cursor/bc-8ef3ffe9-d651-445a-848a-ef433640bd8d-211c

Conversation

@cursor

@cursor cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

背景

Push main@f4a6ac2(合并 #68)后 ootb success30096150517)。审查 #68 合入后的进度条残余 SOLID 债并提交补丁。

审查(原则标注)

级别 原则 问题
MAJOR LSP / OCP 未知→已知总量仍靠重 start 冒充改刻度;ProgressHandlesetTotal
MAJOR LSP binder 首帧 start(total, 0)update(dl) → 非 TTY 先打出虚假 0%
MAJOR DRY createTerminalProgressstart/update 各自拼非 TTY 百分比日志
MINOR LSP 嵌套 pause 测只断言 active,未验证内层 resume 不重绘;无意义 Writable 烟测

改动

  1. ProgressHandle.setTotal + binder 未知→已知走 setTotal(不再重 start)
  2. binder 首帧 start(totalMb, dlMb, …),避免虚假 0%
  3. 非 TTY 日志单一出口 emitNonTty(start/update 共用)
  4. 加强嵌套 pause 写流断言;补齐 setTotal / 非 TTY 首帧契约测

验证

  • npm test -w @sfmc-bds/cli(19 pass)
  • npm run typecheck -w @sfmc-bds/sdk

未改

Open in Web View Automation 

#68 合入后仍用重 start 改总量,且首帧 start(0) 会在非 TTY 打出虚假 0%。
新增 setTotal;binder 首帧带已下载量;非 TTY 日志单一出口;加强 pause 契约测。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 24, 2026 13:22
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Tanya7z
Tanya7z merged commit 5250c43 into main Jul 24, 2026
1 check passed
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