Косметические правки по фронту, раскатка приложения в продакшн версии, исправление бага с созданием контакта
This commit is contained in:
@@ -23,6 +23,7 @@ from app.main import (
|
||||
BitrixClient,
|
||||
TokenCipher,
|
||||
canonical_fingerprint,
|
||||
imconnector_send_fields,
|
||||
normalize_event,
|
||||
resolve_inbound_file_urls,
|
||||
retry_delay,
|
||||
@@ -278,3 +279,23 @@ async def test_bitrix_call_refreshes_and_retries_once_after_401():
|
||||
assert result == {"ok": True}
|
||||
assert auth_values == ["old-access", "new-access"]
|
||||
assert refresh_calls == [False, True]
|
||||
|
||||
|
||||
def test_imconnector_send_fields_maps_name_and_phone():
|
||||
payload = {
|
||||
"message_id": "mid",
|
||||
"external_chat_id": "chat",
|
||||
"occurred_at": "2026-07-10T09:00:00Z",
|
||||
"user": {"id": "uid", "display_name": "Иван Иванов", "phone": "+79990000000"},
|
||||
"message": {"text": "hello", "files": []},
|
||||
}
|
||||
fields = imconnector_send_fields("han_mobile_app", "8", payload)
|
||||
assert fields["MESSAGES[0][user][name]"] == "Иван Иванов"
|
||||
assert fields["MESSAGES[0][user][phone]"] == "+79990000000"
|
||||
legacy = {
|
||||
**payload,
|
||||
"user": {"id": "uid", "display_name": "+79990000000"},
|
||||
}
|
||||
legacy_fields = imconnector_send_fields("han_mobile_app", "8", legacy)
|
||||
assert "MESSAGES[0][user][phone]" not in legacy_fields
|
||||
assert legacy_fields["MESSAGES[0][user][name]"] == "+79990000000"
|
||||
|
||||
Reference in New Issue
Block a user