feat(feishuadapter): 落地严格审批状态机(单一真相/严格回调/LIFO)#657
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
已修复这条高优先级 review: 本次改动:
验证:
|
Collaborator
Author
|
/code 提升测试覆盖率,90以上,完成后推送到我的分支 |
完成已补充 验证结果:
已提交并推送到当前 PR 分支: |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
完成情况已补充 本次补测
校验结果
|
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
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.
背景
主要改动
ApprovalFSMState作为审批单一真相(run 级)。run_key/card_id + request_id + active_request_id + displaying_pending。pending_stack(LIFO),resolve active 后立即 promote 栈顶 pending。untrackRun全量清理 FSM 与索引,旧 outbox 通过generation/version不匹配失效。sessionBinding.ApprovalRecords降级为派生渲染数据。本轮 Review Fix
confirmApprovalOutbox与状态迁移并发读写fsm.Version的 data race。generation/version,旧操作直接丢弃,不再发网络请求)。request_id -> run解析:优先校验 scoped 索引与 FSM 一致性,回退扫描 scoped 索引避免跨 run request_id 误判。测试
go test ./internal/feishuadapter -run TestPermission -count=1go test ./internal/feishuadapter -count=1go test ./internal/feishuadapter -race -run TestPermission -count=1go test ./internal/feishuadapter -race -count=1TestPermissionQueueSwitchPrefersNewestPendingAfterResolveTestApprovalOutboxPreflightDropsStaleOperationTestTryHandleTextPermissionRepliesIgnoredWhenRequestNotActive