Skip to content

fix(solid): HTTP 信封 LSP + moduleAuth 经 ctx(#21 跟进)#22

Merged
Tanya7z merged 3 commits into
mainfrom
cursor/bc-2131ebf4-ef0f-47c9-b43a-fefb699df606-1b11
Jul 22, 2026
Merged

fix(solid): HTTP 信封 LSP + moduleAuth 经 ctx(#21 跟进)#22
Tanya7z merged 3 commits into
mainfrom
cursor/bc-2131ebf4-ef0f-47c9-b43a-fefb699df606-1b11

Conversation

@cursor

@cursor cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

审查 main push 6e08f50(merge #21)后的 DRY · OCP · DIP · LSP · LoD 跟进补丁。

审查发现 → 已修

级别 原则 问题 修复
MAJOR LSP HttpDB.typedRequest 只看 ok!==false,HTTP 200 + {success:false} 误判成功 isSuccessfulHttpEnvelope 同时认 ok/success 方言 + 单测
MAJOR LSP /api/sfmc/services 成功用 ok、失败用 success(与文档不符) 失败体统一 {ok:false,error,code}
MINOR LSP configs/:key/set 成功 ok:true、失败 success:false 失败改为 ok:false
MINOR LoD / DRY 三路由深挖 req.moduleAuth 私有字段 + 重复 ModuleAuth/getModuleAuth 鉴权写入 ctx.moduleAuth;类型进 _shared
MINOR AGENTS.md 仍称 economy FROM ? 未修 注明已由 sql-helpers 修复

仍未修(已知债,非本 PR 范围)

  • DIP: host token 注入 / 进程级 HttpDB.authToken
  • LSP: db.tx 录制器语义(本地假返回 + 丢弃服务端 results)
  • OCP: economy handler 仍在 index.ts 硬编码接线

Test plan

  • cd db-server && npm test(6/6)
  • node --experimental-strip-types --test modules/sdk/@sfmc-sdk/src/sapi/runtime/http-envelope.test.ts(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 12:33
HttpDB 原先只看 ok!==false,HTTP 200 + {success:false} 会被误判为成功。
抽出无 Minecraft 依赖的 isSuccessfulHttpEnvelope 并加单测钉死契约。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
- LoD/DRY: 鉴权结果写入 ctx.moduleAuth,共享 ModuleAuth 类型,不再挂 req 私有字段
- LSP: /api/sfmc/services 失败体改为 {ok:false,...},与成功路径及文档一致
- LSP: configs/:key/set 失败改为 ok:false,与 ok:true 对齐

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

cursor Bot commented Jul 22, 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 ee8f196 into main Jul 22, 2026
1 check passed
@Tanya7z
Tanya7z deleted the cursor/bc-2131ebf4-ef0f-47c9-b43a-fefb699df606-1b11 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