fix(solid): HTTP 信封 LSP + moduleAuth 经 ctx(#21 跟进)#22
Merged
Tanya7z merged 3 commits intoJul 22, 2026
Conversation
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
marked this pull request as ready for review
July 22, 2026 12:46
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
审查 main push
6e08f50(merge #21)后的 DRY · OCP · DIP · LSP · LoD 跟进补丁。审查发现 → 已修
HttpDB.typedRequest只看ok!==false,HTTP 200 +{success:false}误判成功isSuccessfulHttpEnvelope同时认ok/success方言 + 单测/api/sfmc/services成功用ok、失败用success(与文档不符){ok:false,error,code}configs/:key/set成功ok:true、失败success:falseok:falsereq.moduleAuth私有字段 + 重复ModuleAuth/getModuleAuthctx.moduleAuth;类型进_sharedFROM ?未修仍未修(已知债,非本 PR 范围)
HttpDB.authTokendb.tx录制器语义(本地假返回 + 丢弃服务端 results)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)