Telegram-style progress ring для фото/файлов + batch DB writes оптимизация

This commit is contained in:
2026-04-17 03:06:47 +05:00
parent ab23c7c577
commit c3c708b5b3
13 changed files with 766 additions and 248 deletions

View File

@@ -764,9 +764,11 @@ final class DeliveryReliabilityTests: XCTestCase {
XCTAssertTrue(MessageCellLayout.isGarbageOrEncrypted("CHNK:chunk1::chunk2::chunk3"),
"Must detect chunked format")
// Long hex string (40 chars)
XCTAssertTrue(MessageCellLayout.isGarbageOrEncrypted(String(repeating: "a1b2c3d4", count: 6)),
"Must detect long hex strings")
// Long hex string must NOT be flagged (public keys, tx hashes are valid user content)
XCTAssertFalse(MessageCellLayout.isGarbageOrEncrypted(String(repeating: "a1b2c3d4", count: 6)),
"Long hex strings (public keys, hashes) must not be flagged")
XCTAssertFalse(MessageCellLayout.isGarbageOrEncrypted("02abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890ab"),
"secp256k1 public key must not be flagged")
// U+FFFD only (failed decryption)
XCTAssertTrue(MessageCellLayout.isGarbageOrEncrypted("\u{FFFD}\u{FFFD}\u{FFFD}"),