fix(identity): 统一 metadata.user_id 的 device_id 来源,消除身份不一致#1305
Closed
DaydreamCoding wants to merge 1 commit intoWei-Shaw:mainfrom
Closed
fix(identity): 统一 metadata.user_id 的 device_id 来源,消除身份不一致#1305DaydreamCoding wants to merge 1 commit intoWei-Shaw:mainfrom
DaydreamCoding wants to merge 1 commit intoWei-Shaw:mainfrom
Conversation
问题:同一账号在不同代码路径(buildOAuthMetadataUserID、测试请求、 token 刷新)使用不同的 device_id 来源(GetClaudeUserID / 随机生成 / fingerprint 缓存),导致上游看到同一账号发出的请求带有不同身份标识。 修复: - buildOAuthMetadataUserID: 统一使用 fp.ClientID 作为 device_id, 移除 GetClaudeUserID() 和 generateClientID() 随机 fallback - generateSessionString: 改为接收确定性参数 (clientID, accountUUID), 不再随机生成 device_id - AccountTestService: 注入 IdentityService,测试请求复用 fingerprint 缓存中的 ClientID,与正常请求保持一致 - GetOrCreateFingerprint: 修复缓存中 ClientID 为空的异常(旧数据兼容) - RefreshToken: 从上游响应中提取 account_uuid / org_uuid - ClaudeTokenRefresher: 自动刷新时将 UUID 持久化到 account.Extra - refreshSingleAccount: 手动刷新时将 UUID 写入 Extra 并持久化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27e7a78 to
288106f
Compare
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.
问题:同一账号在不同代码路径(buildOAuthMetadataUserID、测试请求、
token 刷新)使用不同的 device_id 来源(GetClaudeUserID / 随机生成 / fingerprint 缓存),导致上游看到同一账号发出的请求带有不同身份标识。
修复: