fix(solid@894436a): 模块鉴权注入 + configs/all modules/tokens + tx 契约 - #31
Merged
Tanya7z merged 3 commits intoJul 22, 2026
Merged
Conversation
审查 main@894436a(#29) 后修复: - DIP/DRY: configs/all.modules 与 /modules 同源注入,并下发 module_tokens 供 SAPI 注入(无法读 data/module-tokens.json) - LSP/DRY: jsonV2Ok 与 Fail 对称;db/service 路由统一走助手 - DRY: setModuleEnabled 走 saveModuleLock;ootb 必备包从发包清单派生 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
- DIP: bootModule 从 ConfigManager(module_tokens) 调用 set*ModuleContext - OCP: ModuleId 改为开放 string(catalog id),启停双索引 id/configKey - LSP: tx.call→Promise<void>;tx.update 录制期无假读回;TxError 保留 step/code - DIP: 空 authToken 不传,避免挡住 HttpDB 默认回落;缺上下文 fail-fast - AFK: config.getAll + 修正 onChange 签名误用 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
npm-publish tag @sfmc-bds/tools@v0.1.1 曾因 package.json 仍为 0.1.0 失败。 同步 bump;HttpDB 空串回落平台默认;publish 清单校验路径/name。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
更新说明(已推送 937cb8d)
本 PR 现已吸收 #30(tools@0.1.1 / HttpDB.resolveAuthToken / publish 路径·name 校验),并保留模块鉴权注入等 BLOCKER 修复。建议合本 PR 后关闭 #30。
合入后请对 @sfmc-bds/tools@v0.1.1 做 workflow_dispatch(checkout 默认分支)以真正发包。
验证:ootb 11/11;PUBLISH_TAG=@sfmc-bds/tools@v0.1.1 node tools/resolve-npm-publish-tag.mjs → Version OK。
Sent by Cursor Automation: SFMC-Review
Tanya7z
marked this pull request as ready for review
July 22, 2026 16:59
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 was referenced Jul 22, 2026
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.


背景
Push
main@894436a(合入 #29)后 ootb 已绿。审查仍发现可验证 SOLID 缺口,尤其 SAPI 从未调用set*ModuleContext,且GET /api/sfmc/configs/all硬编码modules: [],导致 ModuleRegistry 启停与 v2 鉴权链路空转。审查结论(DRY / OCP / DIP / LSP / Demeter)
set*ModuleContext无调用方;module-tokens.jsonSAPI 不可读configs/all.module_tokens+bootModule注入configs/all.modules恒[],与/modules分裂listModules=buildModuleListModuleId绑死旧Modules枚举,AFK 的feature-afk无法 isActiveModuleId=string+ id/configKey 双索引tx.call伪返回U;TxError分支被post()吞掉Promise<void>+ 保留 step/codetx.update把 patch 假扮成整行Promise<void>authToken挡住 HttpDB 默认回落writeJsonlock / ootb 包列表jsonV2Fail/Ok、saveModuleLock、发包清单派生config.get("afk")/onChange签名误用getAll+ 修正回调未改(需设计)
enabledSet热更新验证
db-servernpm test:9/9@sfmc-bds/sdktypecheck 通过SFMC_ROOT=$PWD node tools/check-ootb.mjs:11/11