Skip to content

fix(solid): sql-helpers 权威入口 + tx requires 单点 + withModuleId DRY#20

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/bc-1dff69ca-e595-4f57-b244-eaad6924beac-75a0
Closed

fix(solid): sql-helpers 权威入口 + tx requires 单点 + withModuleId DRY#20
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/bc-1dff69ca-e595-4f57-b244-eaad6924beac-75a0

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

审查 main push(合并 #19 economy SQL rebind + #13 config/service 门)后的 DRY · OCP · DIP · LSP · LoD 跟进补丁。ootb CI 在 #19 合并后已绿;本 PR 修高置信契约/重复问题。

已修复

级别 原则 问题 修复
MAJOR DRY #19economy.ts 另造本地 sql(),与 sql-helpers.raw 并存;且 ${raw(table)} 插值实测仍变 FROM ?(脚枪) 提升 sql()sql-helpers 权威入口;文档/测试钉死 raw 只能 .append
MAJOR DRY / LSP TxRunner.doService 重复 requires 预检;未注册服务在 tx 路径误报 not_in_requires,HTTP 为 no_such_service requires/自调用只走 ServiceRegistry.dispatchdomain_error 透传 TxError
MAJOR DRY config/db/service 三份 withModuleId#13 又加第三份) HttpDB.withModuleId(path, moduleId)
MINOR npm test 找不存在的 src/*.test.js 改为 build && node --test dist/*.test.js

仍未修(已知债,非本轮)

  • DIP: host token 注入 / 进程级共享 HttpDB.authToken
  • LSP: db.tx 录制器语义;响应信封 ok vs success
  • OCP: economy handler 仍在 index.ts 硬编码接线
  • LoD: req.moduleAuth 私有字段

Test plan

  • cd db-server && npm test(6/6)
  • SFMC_ROOT=$PWD node tools/check-ootb.mjs(10/10)
  • CI ootb on this PR
Open in Web View Automation 

cursoragent and others added 3 commits July 22, 2026 07:00
#19 在 domain 内另造 sql(),与未使用且易误用的 raw() 并存(DRY)。
sql() 现为「标识符嵌入 + 值绑定」唯一入口;补充 raw() 插值脚枪测试,
并修正 npm test 指向 dist/*.test.js。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
移除 doService 重复 requires 预检(DRY),避免未注册服务在 tx 路径
被误报为 not_in_requires(LSP)。DispatchError.domain_error 透传给 TxError。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
config/db/service 各有一份 withModuleId(#13 又加了第三份)。
统一到 HttpDB.withModuleId(path, moduleId)(DRY/LSP)。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>

@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.

审查跟进:本 PR 已被取代

main 上的 2dbb079@sfmc@sfmc-bds 发包)使本分支与 db-server/package.json / economy.ts 等产生冲突。

ootb 在该 push 上已绿;SOLID 修复已在当前 main 上重放并扩展(含 npm-publish DRY + Node 22.22 对齐),见后续 PR(本 automation 新开)。

建议关闭本草稿 #20,改审新 PR。

Open in Web View Automation 

Sent by Cursor Automation: SFMC-Review

@Tanya7z

Tanya7z commented Jul 22, 2026

Copy link
Copy Markdown
Member

Superseded by #21 (rebased onto main@2dbb079 with npm-publish DRY). Closing as outdated.

@Tanya7z Tanya7z closed this Jul 22, 2026
Tanya7z added a commit that referenced this pull request Jul 22, 2026
…90b6-c4594f084a07-69fe

fix(solid): sql-helpers + tx requires 单点 + npm-publish DRY(取代 #20
@Tanya7z
Tanya7z deleted the cursor/bc-1dff69ca-e595-4f57-b244-eaad6924beac-75a0 branch July 22, 2026 14:13
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