fix(avatar): acknowledge BOXIM messages as read

This commit is contained in:
stefanfeng
2026-08-20 17:10:54 +08:00
parent 64b7680ec4
commit e2b928273c
4 changed files with 90 additions and 1 deletions
@@ -96,6 +96,18 @@ async def test_send_private_message_matches_boxim_payload(config):
}
@pytest.mark.asyncio
async def test_mark_private_messages_read_uses_latest_message_id(config):
mocked, client = _client_patch(request_payload={"code": 200, "data": None})
with mocked:
await BoxIMClient(config).mark_private_messages_read("box-token", "77", "101")
call = client.request.await_args
assert call.args[:2] == ("PUT", "https://im.example/api/message/private/readed")
assert call.kwargs["headers"] == {"accessToken": "box-token"}
assert call.kwargs["params"] == {"friendId": 77, "messageId": 101}
@pytest.mark.asyncio
async def test_boxim_auth_error_is_explicit(config):
mocked, _ = _client_patch(