fix(huya): 区分当前绑定与待确认角色

This commit is contained in:
yml
2026-11-14 09:33:51 +08:00
parent 269a8d1b11
commit 5b117e7641
6 changed files with 572 additions and 55 deletions
+8 -8
View File
@@ -1071,11 +1071,11 @@ class TestCollabCkProbe(TestCollabBase):
assert inner["is_use_outer_act_id"] == 0
assert inner["scene"] == "undefined"
def test_verify_queries_second_path_for_latest_role(self):
"""外层返回旧角色时,必须取第二路(outerActId=空)的最新角色。"""
def test_verify_uses_outer_current_role_instead_of_inner_pending_role(self):
"""待绑定状态取外层当前角色;内层新角色不能覆盖外部单绑定快照。"""
order = self._row_with_ck(uid="1199647239697")
class StaleThenLatestClient:
class CurrentThenPendingClient:
def __init__(self):
self.calls: list[dict] = []
@@ -1085,7 +1085,7 @@ class TestCollabCkProbe(TestCollabBase):
return FakeBindResp(nick="冰点", role="软芙乎")
return FakeBindResp(nick="冰点", role="唉哟酪酪")
client = StaleThenLatestClient()
client = CurrentThenPendingClient()
collab.verify_ck(self.db, self.user, order, client=client)
@@ -1094,11 +1094,11 @@ class TestCollabCkProbe(TestCollabBase):
assert inner["outer_act_id"] == ""
assert inner["gid"] == collab.PROBE_GID == 3203
assert inner["scene"] == "undefined"
# 快照落的是第二路的最新角色,而不是外层旧角色
assert order.bind_game_role == "唉哟酪酪"
# 2026-11-14 HAR:外层是当前绑定,内层是待确认新角色。
assert order.bind_game_role == "软芙乎"
assert order.bind_game_account == "冰点"
assert "唉哟酪酪" in order.ck_check_message
assert "软芙乎" not in order.ck_check_message
assert "软芙乎" in order.ck_check_message
assert "唉哟酪酪" not in order.ck_check_message
def test_verify_marks_invalid_when_status_is_not_200(self):
order = self._row_with_ck()