Skip to content

fix(pack-update): 补齐未知总量进度条 LSP + DRY bindOk/touchBinding - #67

Merged
Tanya7z merged 1 commit into
mainfrom
cursor/bc-43f6f390-1374-438e-85d5-24cdcac94e9a-f2ad
Jul 24, 2026
Merged

fix(pack-update): 补齐未知总量进度条 LSP + DRY bindOk/touchBinding#67
Tanya7z merged 1 commit into
mainfrom
cursor/bc-43f6f390-1374-438e-85d5-24cdcac94e9a-f2ad

Conversation

@cursor

@cursor cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

背景

Push main@56466b8(合并 #66)后 ootb success。审查 #64#66 合入后的 pack-update / 进度条残余 SOLID 债并提交补丁。

审查(原则标注)

级别 原则 问题
MAJOR LSP #66httpDownload finish 在 total=0 时用 finalBytes 作总量,但 bindByteProgressToBar 仍以占位 1MB start,总量变已知后不重设刻度 → bar 的 {value}/{total} 失真
MAJOR DRY probe / bind 两处各自拼 packUpdate.bindOk 参数;prepareCheck / applyUpdate 多出口散落 setBinding
MINOR OCP needKey 文案写死 CurseForge,与「多源 resolveConfiguredPackProvider」入口契约不一致

改动

  1. bindByteProgressToBar:未知→已知总量时重 start 修正刻度(对齐 httpDownload LSP)
  2. 抽取 bindOkParams / touchBinding
  3. needKey zh/en 改为源无关开场 + CF 作为当前实现提示
  4. terminal-progress.test.mjs 覆盖未知总量收尾契约

验证

  • npm test -w @sfmc-bds/cli(17 pass)
  • npm test -w @sfmc-bds/bds-tools(21 pass)
  • typecheck:cli / bds-tools / sdk

未改

  • ServiceId pack-manager 注册(主路径已不 spawn,CLI 仍可用)
  • ootb 强制跑 pack-update / eslint-plugin tests
Open in Web View Automation 

#66 让 httpDownload 在无 Content-Length 时用 finalBytes 补最终进度回调,
但 bindByteProgressToBar 仍以占位 1MB start,总量变已知后不重设刻度。
重 start 对齐契约;抽取 bindOkParams / touchBinding;needKey 文案源无关化。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 24, 2026 12:48
@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 dab1ad6 into main Jul 24, 2026
1 check passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查(#67 合入后 · main@dab1ad6)

ootb:success 30094461300#67 的未知总量重 start / bindOkParams / touchBinding / needKey 源无关化方向正确。发现合入后残余债,已出补丁 PR。

MAJOR — LSP(bindByteProgressToBar

start / 未知→已知重 start 后省略 update:首帧卡在 0;非 TTY 若 finish 只有一次回调会丢最终刻度。违反与 httpDownload 渐进回调的可替换契约。

MAJOR — LSP(createTerminalProgress.start

非 TTY logger 写死 进度 0% (0/${total}),忽略 startValueProgressHandle.start(total, startValue) 契约在重 start 修总量时被破坏。

MAJOR — DRY/LSP(测试)

原 pause/resume 嵌套契约测被换成无意义 Writable 烟测,注册表权威实现失覆盖。

跟进

补丁已开后续 PR:始终 update + logger 尊重 startValue + 恢复 pause 契约测。

未改(MINOR 债)

  • ServiceId pack-manager 注册
  • ootb 扩测 eslint-plugin / pack-update
  • ProgressHandle.setTotal(可选 OCP 收敛)
Open in Web View Automation 

Sent by Cursor Automation: SFMC-Review

Tanya7z added a commit that referenced this pull request Jul 24, 2026
…b2de-7a236848b621-9bcb

fix(progress): 补齐 #67 后 binder 首帧/非TTY LSP + 恢复 pause 契约测
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