=== Eye Viewer Log Cleared at 2026-01-18 18:47:29 +0000 ===
[19:47:29] [CRASH] No crash detected
[19:47:29] [LOG] Log rotation interval exceeded (2h) - clearing logs
[19:47:29] [FONT] Roboto fonts loaded successfully: Roboto-Regular
[19:47:29] [FONT] ChatFont.regular(18) returns: Roboto-Regular, family: Roboto
[19:47:29] [GIPHY] SDK not available - using REST API fallback
[19:47:29] [BACKGROUND] Background fetch enabled
[19:47:29] [AUTH] Starting PIN authentication
[19:47:29] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[19:47:29] [CLEANUP] No old timer messages to delete
[19:47:29] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[19:47:29] [PUSH] APNs token: 6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c
[19:47:29] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[19:47:29] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[19:47:29] [USER] ✅ User registered successfully
[19:47:29] [PUSH] User registration after token update: success
[19:47:29] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[19:47:29] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[19:47:29] [PRELOAD] ⚡ Starting message pre-load during authentication (since_id=18173)...
[19:47:29] [CLIENT_SIG] WebSocket opened
[19:47:29] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[19:47:29] [CLIENT_SIG] Connected! clientId=YqyeRfqGTaLtbzqe
[19:47:29] [CLIENT_SIG] Received 2 clients for session 'ILUIWU' (my session: 'ILUIWU')
[19:47:29] [PRELOAD] No messages or parse error
[19:47:29] [CLIENT_SIG] - Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:47:29] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[19:47:30] [CLIENT_SIG] Typing stop from: Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:47:31] [CLIENT_SIG] Typing start from: Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:47:31] [PIN_AUTH] Correct PIN
[19:47:31] [SECURITY] Restored real session: ILUIWU
[19:47:31] [SECURITY] Restored real session: ILUIWU
[19:47:31] [SECURITY] Saved real session: ILUIWU
[19:47:31] [SCENE] Launched directly to chat view with sessionId: ILUIWU
[19:47:31] [AUDIO] ✅ Chat mode - audio will be managed by WebRTCViewer (no microphone)
[19:47:31] Documents Directory: /var/mobile/Containers/Data/Application/0323A6A9-E7A4-45D0-B237-86B584E247AE/Documents
[19:47:31] [THEME] Applying current theme
[19:47:31] [CHAT] Applied day theme (mode: day)
[19:47:31] [SECURITY] Saved real session: ILUIWU
[19:47:31] [CLIENT_SIG] Setting up client signaling for session: ILUIWU
[19:47:31] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[19:47:31] [NETWORK] Network monitor started
[19:47:31] [NETWORK] Status changed: connected
[19:47:31] Did transition
[19:47:31] [UPLOAD_QUEUE] Found 0 pending uploads to resume
[19:47:31] [MODE] 🔍 updateModeUI called - currentTabIndex=0, sessionId=ILUIWU
[19:47:31] [VIEWER] Screen lock enabled - normal idle behavior
[19:47:31] [QUERY] 🔍 Creating query connection for iOS slave: iosILUIWU
[19:47:31] [VCC] ========== VideoConnectionClass INIT ==========
[19:47:31] [VCC] Session: iosILUIWU, ViewIdx: 0, AgentId: nil
[19:47:31] [DATA AUDIO] ========== setupWebRTC() START ==========
[19:47:31] [DATA AUDIO] Using data channel for audio - bypassing WebRTC audio device
[19:47:31] [DATA AUDIO] Creating encoder/decoder factories...
[19:47:31] [CODEC] Viewer - Available video codecs: H264, H264, VP8, VP9, AV1
[19:47:31] [CODEC] Viewer selected encoder: AV1 (best quality)
[19:47:31] [DATA AUDIO] Creating RTCPeerConnectionFactory...
[19:47:31] [DATA AUDIO] ✅ Factory created
[19:47:31] [DATA AUDIO] RTCAudioSession locked
[19:47:31] [DATA AUDIO] Set useManualAudio=true, isAudioEnabled=false
[19:47:31] [DATA AUDIO] RTCAudioSession unlocked
[19:47:31] [DATA AUDIO] Skipping AVAudioSession config - handled by DataChannelAudioPlayer
[19:47:31] [VCC] Initial ICE servers: ["stun:stun.l.google.com:19302", "turn:crivello.dyndns.org:3478?transport=udp", "turn:crivello.dyndns.org:3478?transport=tcp", "turns:crivello.dyndns.org:5349?transport=tcp"]
[19:47:31] [WS] Creating new WebSocket - isQueryOnly=false, connectionStr=iosILUIWU
[19:47:31] [WS] Opening session at ws://crivello.dyndns.org:8081/
[19:47:31] [QUERY] ✅ tempQueryConnection created for iosILUIWU
[19:47:31] [VIEWER_INIT] Already have 50 messages - just filtering for tab
[19:47:31] [EVENT_POLL] Event polling disabled - using WebSocket events instead
[19:47:31] [ORIENTATION] Updated pagingScrollView height to 247.5 for width 440.0
[19:47:31] Did transition
[19:47:31] [TABLEVIEW] cellForRowAt index 0 out of bounds (count=0)
[19:47:31] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[19:47:31] [CHUNK] Merged 841 reactions synchronously
[19:47:31] [RELOAD_TAB] ⏳ Already pending, waiting for debounce
[19:47:31] [GALLERY_DB] Loading ALL media messages for session: ILUIWU
[19:47:31] [MIGRATION] No messages need sender_name backfill
[19:47:31] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[19:47:31] [GALLERY_DB] Raw datesent for msg 18173: '2026-01-18 18:37:42'
[19:47:31] [GALLERY_DB] Raw datesent for msg 18171: '2026-01-18 18:36:13'
[19:47:31] [GALLERY_DB] Raw datesent for msg 18162: '2026-01-18 10:37:29'
[19:47:31] [USER] ✅ User registered successfully
[19:47:31] [USER] User registration successful
[19:47:31] [GALLERY_DB] ✅ Loaded 452 media messages
[19:47:31] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18173
[19:47:31] [INCREMENTAL_SYNC] ✅ No new messages
[19:47:31] [GALLERY] Filtered 452 -> 413 (only with local thumbnails)
[19:47:31] [GALLERY] First 5 after sort (newest first):
[19:47:31] [GALLERY] 0: id=18173, date=2026-01-18 18:37:42, file=c8e574003511e75a.jpg
[19:47:31] [GALLERY] 1: id=18171, date=2026-01-18 18:36:13, file=6881a683a964b6bf.heic
[19:47:31] [GALLERY] 2: id=18162, date=2026-01-18 10:37:29, file=2360d0215b6a2ab2.mov
[19:47:31] [GALLERY] 3: id=18161, date=2026-01-18 10:36:56, file=399b07f80d99b3ff.heic
[19:47:31] [GALLERY] 4: id=18159, date=2026-01-18 10:17:19, file=d709f7e2335b9796.jpeg
[19:47:31] [SCROLL_BTN] Showing button - 32pt from bottom > half 22pt
[19:47:31] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:47:31] [EMOJI] ✅ Loaded 451 emoji-to-GIF mappings
[19:47:31] [CELL_UPLOAD] configure: msgId=18127, file=62b393a353b38c70.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:31] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:31] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=62b393a353b38c70.jpg, overlayExists=true
[19:47:31] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:31] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:31] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[19:47:31] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:31] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:31] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:47:31] [SERVER] Starting reconnect polling (5s interval)
[19:47:31] [ICONS] Screen width: 440.0, Tab spacing: 75.5
[19:47:31] [ICONS] Offset applied: -14.6
[19:47:31] [ICONS] New left margin: 11.2, New right margin: 11.3
[19:47:31] [ICONS] Chat center: (31.2, 87.0)
[19:47:31] [ICONS] Gallery center: (106.7, 87.0), deltaX: 75.5
[19:47:31] [ICONS] Camera center: (182.2, 87.0), deltaX: 75.5
[19:47:31] [ICONS] Settings center: (257.7, 87.0), deltaX: 75.5
[19:47:31] [ICONS] Lock centerX: 333.2, deltaX from Settings: 75.5
[19:47:31] [ICONS] Bell centerX: 408.7, deltaX from Lock: 75.5
[19:47:31] [ICONS] LEFT MARGIN (screen left to Chat left): 11.2
[19:47:31] [ICONS] RIGHT MARGIN (Bell right to screen right): 11.3
[19:47:31] [ICONS] Screen width: 440.0
[19:47:31] DOWNLOADIIING 2360d0215b6a2ab2.mov
[19:47:31] [WS] WebSocket ACTUALLY OPENED - isQueryOnly=true, connectionStr=iosILUIWU
[19:47:31] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[19:47:31] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[19:47:31] Token POST → https://crivello.dyndns.org:443/WebRTC/public/new_session.php?sid=iosILUIWU
[19:47:31] [PUSH] Silent push received
[19:47:31] [PUSH_EMBED] No embedded message_data in notification
[19:47:31] [PUSH] No embedded data, pre-loading messages from server
[19:47:31] [PUSH_PRELOAD] Fetching messages for instant display cache
[19:47:31] [PURGE] ⚠️ Media cache purge DISABLED for debugging
[19:47:31] [UNSENT_RETRY] Checking for unsent messages...
[19:47:31] [UPLOAD_RECOVERY] ========== CHECKING FOR MISSING UPLOADS ==========
[19:47:31] [UPLOAD_RECOVERY] User ID: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF
[19:47:31] [UPLOAD_RECOVERY] Session: ILUIWU
[19:47:31] [UPLOAD_RECOVERY] ✅ No stuck uploads found
[19:47:31] [UPLOAD_RECOVERY] Checking recent media messages on server...
[19:47:31] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18173, file=c8e574003511e75a.jpg, upload_status=complete
[19:47:31] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18171, file=6881a683a964b6bf.heic, upload_status=complete
[19:47:31] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18159, file=d709f7e2335b9796.jpeg, upload_status=complete
[19:47:31] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18127, file=62b393a353b38c70.jpg, upload_status=complete
[19:47:31] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18117, file=ca2813d190665dd2.jpg, upload_status=complete
[19:47:31] [UPLOAD_RECOVERY] Verifying 5 media files exist on server...
[19:47:31] [PENDING_UPLOAD] Total pending upload messages: 0
[19:47:31] [UNSENT_RETRY] No unsent messages found
[19:47:31] [UPLOAD_RECOVERY] ✅ All media files verified on server
[19:47:31] new_session POST ok: token len=157
[19:47:31] HELLO → sent (fetched token, role=query)
[19:47:31] [SIG] hello_ok received for query connection - ready to query agents
[19:47:31] [SIG] get_agents request sent for sessionId=ILUIWU
[19:47:31] [SIG] get_agents request sent for sessionId=iosILUIWU
[19:47:31] [SERVER] Stopped reconnect polling
[19:47:31] [SIG] agents_list received: []
[19:47:31] [SIG] agents_list received: []
[19:47:31] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[19:47:31] [PUSH_PRELOAD] ⚡ Pre-cached 50 messages for instant display (preserved 0 from push)
[19:47:31] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[19:47:31] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("operation_type"): 3, AnyHashable("session_id"): ILUIWU, AnyHashable("message_id"): 18173]
[19:47:31] [PUSH] Parsed message_id: 18173
[19:47:31] [PUSH] Parsed operation_type: 3
[19:47:31] [PUSH] Taking direct action: opType=3, messageId=18173
[19:47:31] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18173
[19:47:31] [COMBINED_FETCH] Loaded 6940 read receipts, 837 messages with reactions
[19:47:31] [READBY_ENRICH] Enriched 50 messages with readBy data
[19:47:32] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:47:32] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:32] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:32] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[19:47:32] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:32] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:32] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:47:41] [CLIENT_SIG] Typing stop from: Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:47:43] [CLIENT_SIG] Event received: type=0 messageId=18174
[19:47:43] [WS_EVENT] Received event: type=0, messageId=18174
[19:47:43] [WS_EVENT] 📨 New message notification (msgId=18174) - triggering incremental refresh, currentMsgCount=50
[19:47:43] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[19:47:43] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18173
[19:47:43] [PUSH] Silent push received
[19:47:43] [PUSH_EMBED] 📩 Received embedded message: id=18174, type=0, sender=Esra
[19:47:43] [PUSH_EMBED] ✅ Saved message 18174 to local DB (sync)
[19:47:43] [PUSH_EMBED] Inserted message 18174 into existing cache (now 51 messages)
[19:47:43] [PUSH_EMBED] Fetching evolution data for message 18174 in background
[19:47:43] [PUSH_EMBED] ✅ Fully processed message 18174
[19:47:43] [PUSH] Embedded message handled instantly from silent push
[19:47:43] [PUSH_UI] 🔔 handlePushMessageReceived CALLED
[19:47:43] [PUSH_UI_BLACKOUT] blackoutView=false, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, type=0
[19:47:43] [PUSH_UI] Inserted message 18174 into UI (now 51 messages)
[19:47:43] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("message_id"): 18174, AnyHashable("message_data"): {
datesent = "2026-01-18 18:47:41";
"file_name" = "";
message = "Yes baby.but today, the cold gave me a migraine, after snowboarding, I spent the rest of the day dozing";
"message_id" = 18174;
"message_type" = 0;
"prev_session_message_id" = 18173;
"replied_message" = "What are you 8 doing in evenings ? Talk mainly ?";
"replied_sender_id" = "3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF";
"replied_sender_name" = Laurent;
"reply_to_id" = 18169;
"sender_id" = "EDAD55A1-003F-415D-AA60-672B34B504FE";
"sender_name" = Esra;
"session_id" = ILUIWU;
timer = 0;
}, AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("operation_type"): 0, AnyHashable("session_id"): ILUIWU]
[19:47:43] [PUSH_EMBED_VC] Message 18174 already in memory - skipping
[19:47:43] [PUSH] ⚡ Embedded message handled directly in ViewController
[19:47:43] [PUSH] Parsed message_id: 18174
[19:47:43] [PUSH] Parsed operation_type: 0
[19:47:43] [PUSH] Taking direct action: opType=0, messageId=18174
[19:47:43] [PUSH] TakeActionFromPush called: OperationType=0, MessageIds=18174
[19:47:43] [PUSH] ⚡ Message 18174 already in memory - skipping duplicate notification entirely
[19:47:43] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[19:47:43] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[19:47:43] [RELOAD_TAB] ⏳ Already pending, waiting for debounce
[19:47:43] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=51
[19:47:43] [PUSH_EMBED] Got evolution data for message 18174, saving to local DB
[19:47:43] [PUSH_EMBED] Saved evolution data for message 18174
[19:47:43] [PUSH] Silent push received
[19:47:43] [PUSH_EMBED] 📩 Received embedded message: id=18174, type=0, sender=Esra
[19:47:43] [PUSH_EMBED] ✅ Saved message 18174 to local DB (sync)
[19:47:43] [PUSH_EMBED] Fetching evolution data for message 18174 in background
[19:47:43] [PUSH_EMBED] ✅ Fully processed message 18174
[19:47:43] [PUSH] Embedded message handled instantly from silent push
[19:47:43] [PUSH_UI] 🔔 handlePushMessageReceived CALLED
[19:47:43] [PUSH_UI_BLACKOUT] blackoutView=false, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, type=0
[19:47:43] [PUSH_UI] Message 18174 already in memory - skipping insert
[19:47:43] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("message_id"): 18174, AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("operation_type"): 0, AnyHashable("session_id"): ILUIWU, AnyHashable("message_data"): {
datesent = "2026-01-18 18:47:41";
"file_name" = "";
message = "Yes baby.but today, the cold gave me a migraine, after snowboarding, I spent the rest of the day dozing";
"message_id" = 18174;
"message_type" = 0;
"prev_session_message_id" = 18173;
"replied_message" = "What are you 8 doing in evenings ? Talk mainly ?";
"replied_sender_id" = "3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF";
"replied_sender_name" = Laurent;
"reply_to_id" = 18169;
"sender_id" = "EDAD55A1-003F-415D-AA60-672B34B504FE";
"sender_name" = Esra;
"session_id" = ILUIWU;
timer = 0;
}]
[19:47:43] [PUSH_EMBED_VC] Message 18174 already in memory - skipping
[19:47:43] [PUSH] ⚡ Embedded message handled directly in ViewController
[19:47:43] [PUSH] Parsed message_id: 18174
[19:47:43] [PUSH] Parsed operation_type: 0
[19:47:43] [PUSH] Taking direct action: opType=0, messageId=18174
[19:47:43] [PUSH] TakeActionFromPush called: OperationType=0, MessageIds=18174
[19:47:43] [PUSH] ⚡ Message 18174 already in memory - skipping duplicate notification entirely
[19:47:43] [PUSH_EMBED] Got evolution data for message 18174, saving to local DB
[19:47:43] [PUSH_EMBED] Saved evolution data for message 18174
[19:47:43] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:47:43] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:43] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:43] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[19:47:43] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:43] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:43] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:47:43] [EVOLUTION_FILTER] 📝 Updated lastSeenMessageId after marking as read: 18173 → 18174
[19:47:45] [SCROLL_BTN] Showing button - 217pt from bottom > half 196pt
[19:47:45] [PUSH] Silent push received
[19:47:45] [PUSH_EMBED] No embedded message_data in notification
[19:47:45] [PUSH] No embedded data, pre-loading messages from server
[19:47:45] [PUSH_PRELOAD] Fetching messages for instant display cache
[19:47:45] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[19:47:45] [PRELOAD_CACHE] Preserving 1 push-inserted messages: [18124]
[19:47:45] [PUSH_PRELOAD] ⚡ Pre-cached 51 messages for instant display (preserved 1 from push)
[19:47:45] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[19:47:45] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("operation_type"): 3, AnyHashable("message_id"): 18174, AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("session_id"): ILUIWU]
[19:47:45] [PUSH] Parsed message_id: 18174
[19:47:45] [PUSH] Parsed operation_type: 3
[19:47:45] [PUSH] Taking direct action: opType=3, messageId=18174
[19:47:45] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18174
[19:47:45] [CLIENT_SIG] Event received: type=3 messageId=18174
[19:47:45] [WS_EVENT] Received event: type=3, messageId=18174
[19:47:45] [WS_EVENT] Read receipt for message 18174 by Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[19:47:46] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[19:47:46] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=51, isReloading=false
[19:47:46] [SEND_MESSAGE] ✅ Added optimistic message id=-1 to arrays, newMsgCount=52
[19:47:46] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=52, first5Ids=[-1, 18174, 18173, 18172, 18171]
[19:47:46] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:46] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:46] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:47:46] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[19:47:46] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[19:47:47] [CLIENT_SIG] Event received: type=0 messageId=18175
[19:47:47] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18175,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 18:47:46"}
[19:47:47] [WS_EVENT] Received event: type=0, messageId=18175
[19:47:47] [WS_EVENT] 📨 New message notification (msgId=18175) - triggering incremental refresh, currentMsgCount=52
[19:47:47] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=52
[19:47:47] [CHAT] receive_message.php JSON: ["file_name": , "message_type": 0, "session_id": ILUIWU, "message_id": 18175, "ok": 1, "datesent_utc": 2026-01-18 18:47:46]
[19:47:47] [DB_UPGRADE] Upgrading message ID: -1 → 18175, preserveOriginalDate=false
[19:47:47] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18174
[19:47:47] [DB_UPGRADE] ✅ Upgraded -1 → 18175 with send_status=0, 1 row(s) affected
[19:47:47] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -1 → 18175
[19:47:47] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -1 → 18175
[19:47:47] ReloadData 9
[19:47:47] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[19:47:47] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:47] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:47] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:47:47] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[19:47:47] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=52
[19:47:47] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=52, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:47:47] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:47:47] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:47:47] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:47:50] [PUSH] Silent push received
[19:47:50] [PUSH_EMBED] No embedded message_data in notification
[19:47:50] [PUSH] No embedded data, pre-loading messages from server
[19:47:50] [PUSH_PRELOAD] Fetching messages for instant display cache
[19:47:50] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[19:47:50] [PRELOAD_CACHE] Preserving 2 push-inserted messages: [18125, 18124]
[19:47:50] [PUSH_PRELOAD] ⚡ Pre-cached 52 messages for instant display (preserved 2 from push)
[19:47:50] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[19:47:50] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("operation_type"): 3, AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("session_id"): ILUIWU, AnyHashable("message_id"): 18175]
[19:47:50] [PUSH] Parsed message_id: 18175
[19:47:50] [PUSH] Parsed operation_type: 3
[19:47:50] [PUSH] Taking direct action: opType=3, messageId=18175
[19:47:50] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18175
[19:47:50] [CLIENT_SIG] Event received: type=3 messageId=18175
[19:47:50] [WS_EVENT] Received event: type=3, messageId=18175
[19:47:50] [WS_EVENT] Read receipt for message 18175 by Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:48:08] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[19:48:08] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=52, isReloading=false
[19:48:08] [SEND_MESSAGE] ✅ Added optimistic message id=-2 to arrays, newMsgCount=53
[19:48:08] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=53, first5Ids=[-2, 18175, 18174, 18173, 18172]
[19:48:08] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:08] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:08] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:08] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[19:48:08] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[19:48:10] [CLIENT_SIG] Event received: type=0 messageId=18176
[19:48:10] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18176,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 18:48:08"}
[19:48:10] [WS_EVENT] Received event: type=0, messageId=18176
[19:48:10] [WS_EVENT] 📨 New message notification (msgId=18176) - triggering incremental refresh, currentMsgCount=53
[19:48:10] [CHAT] receive_message.php JSON: ["datesent_utc": 2026-01-18 18:48:08, "message_id": 18176, "ok": 1, "message_type": 0, "file_name": , "session_id": ILUIWU]
[19:48:10] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=53
[19:48:10] [DB_UPGRADE] Upgrading message ID: -2 → 18176, preserveOriginalDate=false
[19:48:10] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18175
[19:48:10] [DB_UPGRADE] ✅ Upgraded -2 → 18176 with send_status=0, 1 row(s) affected
[19:48:10] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -2 → 18176
[19:48:10] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -2 → 18176
[19:48:10] ReloadData 9
[19:48:10] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[19:48:10] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:10] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:10] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:10] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[19:48:10] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=53
[19:48:10] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=53, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:48:10] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:10] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:10] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:20] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[19:48:20] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=53, isReloading=false
[19:48:20] [SEND_MESSAGE] ✅ Added optimistic message id=-3 to arrays, newMsgCount=54
[19:48:20] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=54, first5Ids=[-3, 18176, 18175, 18174, 18173]
[19:48:20] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:20] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:20] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:20] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[19:48:20] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[19:48:21] [MENU] dismissAnyExistingMenu called
[19:48:21] [MENU] dismissAnyExistingMenu completed
[19:48:21] [MENU] Created button 'Reply' at index 0
[19:48:21] [MENU] Created button 'Edit' at index 1
[19:48:21] [MENU] Created button 'Copy' at index 2
[19:48:21] [MENU] Menu added at y=476.5
[19:48:22] [CLIENT_SIG] Event received: type=0 messageId=18177
[19:48:22] [WS_EVENT] Received event: type=0, messageId=18177
[19:48:22] [WS_EVENT] 📨 New message notification (msgId=18177) - triggering incremental refresh, currentMsgCount=54
[19:48:22] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=54
[19:48:22] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18176
[19:48:22] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18177,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 18:48:20"}
[19:48:22] [CHAT] receive_message.php JSON: ["file_name": , "message_id": 18177, "ok": 1, "session_id": ILUIWU, "message_type": 0, "datesent_utc": 2026-01-18 18:48:20]
[19:48:22] [DB_UPGRADE] Upgrading message ID: -3 → 18177, preserveOriginalDate=false
[19:48:22] [DB_UPGRADE] ✅ Upgraded -3 → 18177 with send_status=0, 1 row(s) affected
[19:48:22] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -3 → 18177
[19:48:22] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -3 → 18177
[19:48:22] ReloadData 9
[19:48:22] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[19:48:22] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:22] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:22] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:22] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[19:48:22] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=54
[19:48:22] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=54, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:48:22] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:22] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:22] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:23] [MENU] menuButtonTouchDown - button title: Edit, tag: 1
[19:48:23] [MENU] menuButtonTapped - button title: Edit, tag: 1
[19:48:23] [MENU] Button frame: (0.0, 44.0, 120.0, 44.0), superview: true
[19:48:23] [MENU] Found action closure, dismissing menu first
[19:48:23] [MENU] dismissAnyExistingMenu called
[19:48:23] [MENU] Found menu with tag 9999, removing
[19:48:23] [MENU] Removing blur effect
[19:48:23] [MENU] Removing floating message snapshot
[19:48:23] [MENU] Recorded dismissal time for debounce
[19:48:23] [MENU] dismissAnyExistingMenu completed
[19:48:23] [MENU] Menu dismissed, executing action
[19:48:23] [MENU] Action executed
[19:48:23] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:23] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:23] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[19:48:23] [SCROLL_BTN] Showing button - 328pt from bottom > half 214pt
[19:48:27] ReloadData 11 - applying tab 0 filtering after message edit
[19:48:27] [PUSH] Silent push received
[19:48:27] [PUSH_EMBED] No embedded message_data in notification
[19:48:27] [PUSH] No embedded data, pre-loading messages from server
[19:48:27] [PUSH_PRELOAD] Fetching messages for instant display cache
[19:48:27] [PUSH] Silent push received
[19:48:27] [PUSH_EMBED] No embedded message_data in notification
[19:48:27] [PUSH] No embedded data, pre-loading messages from server
[19:48:27] [PUSH_PRELOAD] Fetching messages for instant display cache
[19:48:27] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=54, first5Ids=[18124, 18125, 18126, 18127, 18128]
[19:48:27] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[19:48:27] [PRELOAD_CACHE] Preserving 4 push-inserted messages: [18127, 18126, 18125, 18124]
[19:48:27] [PUSH_PRELOAD] ⚡ Pre-cached 54 messages for instant display (preserved 4 from push)
[19:48:27] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[19:48:27] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[19:48:27] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[19:48:27] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[19:48:27] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("message_id"): 18177, AnyHashable("session_id"): ILUIWU, AnyHashable("operation_type"): 3]
[19:48:27] [PUSH] Parsed message_id: 18177
[19:48:27] [PUSH] Parsed operation_type: 3
[19:48:27] [PUSH] Taking direct action: opType=3, messageId=18177
[19:48:27] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18177
[19:48:27] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[19:48:27] [PRELOAD_CACHE] Preserving 4 push-inserted messages: [18127, 18126, 18125, 18124]
[19:48:27] [PUSH_PRELOAD] ⚡ Pre-cached 54 messages for instant display (preserved 4 from push)
[19:48:27] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[19:48:27] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("message_id"): 18176, AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("operation_type"): 3, AnyHashable("session_id"): ILUIWU]
[19:48:27] [PUSH] Parsed message_id: 18176
[19:48:27] [PUSH] Parsed operation_type: 3
[19:48:27] [PUSH] Taking direct action: opType=3, messageId=18176
[19:48:27] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18176
[19:48:27] [CLIENT_SIG] Event received: type=3 messageId=18176
[19:48:27] [WS_EVENT] Received event: type=3, messageId=18176
[19:48:27] [WS_EVENT] Read receipt for message 18176 by Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:48:27] [CLIENT_SIG] Event received: type=3 messageId=18177
[19:48:27] [WS_EVENT] Received event: type=3, messageId=18177
[19:48:27] [WS_EVENT] Read receipt for message 18177 by Esra (EDAD55A1-003F-415D-AA60-672B34B504FE)
[19:48:27] [LOCK] Lock button tapped - locking app immediately
[19:48:27] [LOCK] Received lock app notification
[19:48:28] [LIFECYCLE] App resigning active - cleared crash flag
[19:48:28] [SECURITY] sceneDidEnterBackground - isAuthenticated=false
[19:48:28] [SECURITY] ⚠️ NOT saving timestamp - isAuthenticated is false
[19:48:28] [LIFECYCLE] App entering background - cleared crash flag
[19:48:28] [CLIENT_SIG] Disconnecting
[19:48:28] [LIFECYCLE] App entering background - disconnecting connections and stopping audio
[19:48:28] [WS] stopSignalingAndPeer called - isQueryOnly=true, connectionStr=iosILUIWU, wsState=0
[19:48:28] [WS] Canceling WebSocket for query connection to iosILUIWU
[19:48:28] In cleanupPeer
[19:48:28] In cleanupPeer
[19:48:28] [LIFECYCLE] WebRTC audio disabled
[19:48:28] [LIFECYCLE] AVAudioSession deactivated
[19:48:28] [LIFECYCLE] All connections stopped
[19:48:28] [CLIENT_SIG] WebSocket closed with code 1001
[19:48:28] [CLIENT_SIG] Reconnecting in 2.0s (attempt 1)
[19:48:28] [SERVER] Stopped reconnect polling
[19:48:28] Will request stop of video 0
[19:48:28] Will request stop of video 0
[19:48:28] [WS] WebSocket ACTUALLY CLOSED - isQueryOnly=true, connectionStr=iosILUIWU, closeCode=1001
[19:48:28] [WS] Query connection to iosILUIWU closed - cleaning up all agent connections and views
[19:48:32] [CRASH] No crash detected
[19:48:32] [LOG] Within rotation interval - preserving logs (118m until next clear)
[19:48:32] [FONT] Roboto fonts loaded successfully: Roboto-Regular
[19:48:32] [FONT] ChatFont.regular(18) returns: Roboto-Regular, family: Roboto
[19:48:32] [GIPHY] SDK not available - using REST API fallback
[19:48:32] [BACKGROUND] Background fetch enabled
[19:48:32] [CLEANUP] No old timer messages to delete
[19:48:32] [AUTH] Starting PIN authentication
[19:48:32] [PUSH] Silent push received
[19:48:32] [PUSH_EMBED] No embedded message_data in notification
[19:48:32] [PUSH] No embedded data, pre-loading messages from server
[19:48:32] [PUSH_PRELOAD] Fetching messages for instant display cache
[19:48:32] [PUSH] APNs token: 6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c
[19:48:33] [PRELOAD] ⚡ Starting message pre-load during authentication (since_id=18177)...
[19:48:33] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[19:48:33] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[19:48:33] [PRELOAD] No messages or parse error
[19:48:33] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[19:48:33] [PUSH_PRELOAD] ⚡ Pre-cached 50 messages for instant display (preserved 0 from push)
[19:48:33] [USER] ✅ User registered successfully
[19:48:33] [PUSH] User registration after token update: success
[19:48:33] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[19:48:56] [PUSH] Silent push received
[19:48:56] [PUSH_EMBED] 📩 Received embedded message: id=18178, type=0, sender=Esra
[19:48:56] [PUSH_EMBED] ✅ Saved message 18178 to local DB (sync)
[19:48:56] [PUSH_EMBED] Inserted message 18178 into existing cache (now 51 messages)
[19:48:56] [PUSH_EMBED] Fetching evolution data for message 18178 in background
[19:48:56] [PUSH_EMBED] ✅ Fully processed message 18178
[19:48:56] [PUSH] Embedded message handled instantly from silent push
[19:48:56] [PUSH_EMBED] Got evolution data for message 18178, saving to local DB
[19:48:56] [PUSH_EMBED] Saved evolution data for message 18178
[19:51:03] [PUSH] Silent push received
[19:51:03] [PUSH_EMBED] 📩 Received embedded message: id=18179, type=0, sender=Esra
[19:51:03] [PUSH_EMBED] ✅ Saved message 18179 to local DB (sync)
[19:51:03] [PUSH_EMBED] Inserted message 18179 into existing cache (now 52 messages)
[19:51:03] [PUSH_EMBED] Fetching evolution data for message 18179 in background
[19:51:03] [PUSH_EMBED] ✅ Fully processed message 18179
[19:51:03] [PUSH] Embedded message handled instantly from silent push
[19:51:03] [PUSH_EMBED] Got evolution data for message 18179, saving to local DB
[19:51:03] [PUSH_EMBED] Saved evolution data for message 18179
[19:51:55] [PUSH] Silent push received
[19:51:55] [PUSH_EMBED] 📩 Received embedded message: id=18180, type=0, sender=Esra
[19:51:55] [PUSH_EMBED] ✅ Saved message 18180 to local DB (sync)
[19:51:55] [PUSH_EMBED] Inserted message 18180 into existing cache (now 53 messages)
[19:51:55] [PUSH_EMBED] Fetching evolution data for message 18180 in background
[19:51:55] [PUSH_EMBED] ✅ Fully processed message 18180
[19:51:55] [PUSH] Embedded message handled instantly from silent push
[19:51:55] [PUSH_EMBED] Got evolution data for message 18180, saving to local DB
[19:51:55] [PUSH_EMBED] Saved evolution data for message 18180
[20:35:59] [BACKGROUND] Background fetch triggered
[20:35:59] [BACKGROUND] Fetching recent messages for pre-cache
[20:35:59] [BACKGROUND] Fetched 50 messages - saving to DB and pre-caching
[20:35:59] [PRELOAD_CACHE] Preserving 3 push-inserted messages: [18130, 18129, 18128]
[20:35:59] [BACKGROUND] Pre-cached 53 ChatMessage objects for instant display (preserved 3 from push)
[20:35:59] [BACKGROUND] Pre-downloaded 0 thumbnails
[20:35:59] [BACKGROUND] ✅ Background fetch complete with thumbnail pre-download
[20:38:28] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[20:38:28] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:38:28] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[20:38:28] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:38:28] [CLIENT_SIG] WebSocket opened
[20:38:28] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[20:38:28] [CLIENT_SIG] Connected! clientId=JxMsljbnOPL2xvIb
[20:38:28] [CLIENT_SIG] Received 1 clients for session 'ILUIWU' (my session: 'ILUIWU')
[20:38:28] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:38:30] [PIN_AUTH] Correct PIN
[20:38:30] [SECURITY] Restored real session: ILUIWU
[20:38:30] [SECURITY] Restored real session: ILUIWU
[20:38:30] [SECURITY] Saved real session: ILUIWU
[20:38:30] [SCENE] Launched directly to chat view with sessionId: ILUIWU
[20:38:30] [AUDIO] ✅ Chat mode - audio will be managed by WebRTCViewer (no microphone)
[20:38:30] Documents Directory: /var/mobile/Containers/Data/Application/0323A6A9-E7A4-45D0-B237-86B584E247AE/Documents
[20:38:30] [UPLOAD_QUEUE] Found 0 pending uploads to resume
[20:38:30] [THEME] Applying current theme
[20:38:30] [CHAT] Applied day theme (mode: day)
[20:38:30] [SECURITY] Saved real session: ILUIWU
[20:38:30] [CLIENT_SIG] Setting up client signaling for session: ILUIWU
[20:38:30] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[20:38:30] [NETWORK] Network monitor started
[20:38:30] [NETWORK] Status changed: connected
[20:38:30] Did transition
[20:38:30] [MODE] 🔍 updateModeUI called - currentTabIndex=0, sessionId=ILUIWU
[20:38:30] [VIEWER] Screen lock enabled - normal idle behavior
[20:38:30] [QUERY] 🔍 Creating query connection for iOS slave: iosILUIWU
[20:38:30] [VCC] ========== VideoConnectionClass INIT ==========
[20:38:30] [VCC] Session: iosILUIWU, ViewIdx: 0, AgentId: nil
[20:38:30] [DATA AUDIO] ========== setupWebRTC() START ==========
[20:38:30] [DATA AUDIO] Using data channel for audio - bypassing WebRTC audio device
[20:38:30] [DATA AUDIO] Creating encoder/decoder factories...
[20:38:30] [CODEC] Viewer - Available video codecs: H264, H264, VP8, VP9, AV1
[20:38:30] [CODEC] Viewer selected encoder: AV1 (best quality)
[20:38:30] [DATA AUDIO] Creating RTCPeerConnectionFactory...
[20:38:30] [DATA AUDIO] ✅ Factory created
[20:38:30] [DATA AUDIO] RTCAudioSession locked
[20:38:30] [DATA AUDIO] Set useManualAudio=true, isAudioEnabled=false
[20:38:30] [DATA AUDIO] RTCAudioSession unlocked
[20:38:30] [DATA AUDIO] Skipping AVAudioSession config - handled by DataChannelAudioPlayer
[20:38:30] [VCC] Initial ICE servers: ["stun:stun.l.google.com:19302", "turn:crivello.dyndns.org:3478?transport=udp", "turn:crivello.dyndns.org:3478?transport=tcp", "turns:crivello.dyndns.org:5349?transport=tcp"]
[20:38:30] [WS] Creating new WebSocket - isQueryOnly=false, connectionStr=iosILUIWU
[20:38:30] [WS] Opening session at ws://crivello.dyndns.org:8081/
[20:38:30] [QUERY] ✅ tempQueryConnection created for iosILUIWU
[20:38:30] [VIEWER_INIT] Already have 50 messages - just filtering for tab
[20:38:30] [EVENT_POLL] Event polling disabled - using WebSocket events instead
[20:38:30] [ORIENTATION] Updated pagingScrollView height to 247.5 for width 440.0
[20:38:30] Did transition
[20:38:30] [TABLEVIEW] cellForRowAt index 0 out of bounds (count=0)
[20:38:30] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:38:30] [CHUNK] Merged 841 reactions synchronously
[20:38:30] [RELOAD_TAB] ⏳ Already pending, waiting for debounce
[20:38:30] [GALLERY_DB] Loading ALL media messages for session: ILUIWU
[20:38:30] [MIGRATION] No messages need sender_name backfill
[20:38:30] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[20:38:30] [GALLERY_DB] Raw datesent for msg 18173: '2026-01-18 18:37:42'
[20:38:30] [GALLERY_DB] Raw datesent for msg 18171: '2026-01-18 18:36:13'
[20:38:30] [GALLERY_DB] Raw datesent for msg 18162: '2026-01-18 10:37:29'
[20:38:30] [USER] ✅ User registered successfully
[20:38:30] [USER] User registration successful
[20:38:30] [GALLERY_DB] ✅ Loaded 452 media messages
[20:38:30] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18180
[20:38:30] [INCREMENTAL_SYNC] ✅ No new messages
[20:38:30] [GALLERY] Filtered 452 -> 413 (only with local thumbnails)
[20:38:30] [GALLERY] First 5 after sort (newest first):
[20:38:30] [GALLERY] 0: id=18173, date=2026-01-18 18:37:42, file=c8e574003511e75a.jpg
[20:38:30] [GALLERY] 1: id=18171, date=2026-01-18 18:36:13, file=6881a683a964b6bf.heic
[20:38:30] [GALLERY] 2: id=18162, date=2026-01-18 10:37:29, file=2360d0215b6a2ab2.mov
[20:38:30] [GALLERY] 3: id=18161, date=2026-01-18 10:36:56, file=399b07f80d99b3ff.heic
[20:38:30] [GALLERY] 4: id=18159, date=2026-01-18 10:17:19, file=d709f7e2335b9796.jpeg
[20:38:30] [SCROLL_BTN] Showing button - 32pt from bottom > half 22pt
[20:38:30] [SERVER] Starting reconnect polling (5s interval)
[20:38:30] [ICONS] Screen width: 440.0, Tab spacing: 75.5
[20:38:30] [ICONS] Offset applied: -14.6
[20:38:30] [ICONS] New left margin: 11.2, New right margin: 11.3
[20:38:30] [ICONS] Chat center: (31.2, 87.0)
[20:38:30] [ICONS] Gallery center: (106.7, 87.0), deltaX: 75.5
[20:38:30] [ICONS] Camera center: (182.2, 87.0), deltaX: 75.5
[20:38:30] [ICONS] Settings center: (257.7, 87.0), deltaX: 75.5
[20:38:30] [ICONS] Lock centerX: 333.2, deltaX from Settings: 75.5
[20:38:30] [ICONS] Bell centerX: 408.7, deltaX from Lock: 75.5
[20:38:30] [ICONS] LEFT MARGIN (screen left to Chat left): 11.2
[20:38:30] [ICONS] RIGHT MARGIN (Bell right to screen right): 11.3
[20:38:30] [ICONS] Screen width: 440.0
[20:38:30] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18131, 18132, 18133, 18134, 18135]
[20:38:30] [EMOJI] ✅ Loaded 451 emoji-to-GIF mappings
[20:38:30] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:38:30] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:38:30] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:38:30] [EVOLUTION_FILTER] 📝 Updated lastSeenMessageId after marking as read: 18177 → 18178
[20:38:30] [EVOLUTION_FILTER] 📝 Updated lastSeenMessageId after marking as read: 18178 → 18179
[20:38:30] [EVOLUTION_FILTER] 📝 Updated lastSeenMessageId after marking as read: 18179 → 18180
[20:38:30] [PURGE] ⚠️ Media cache purge DISABLED for debugging
[20:38:30] [UNSENT_RETRY] Checking for unsent messages...
[20:38:30] [UPLOAD_RECOVERY] ========== CHECKING FOR MISSING UPLOADS ==========
[20:38:30] [UPLOAD_RECOVERY] User ID: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF
[20:38:30] [UPLOAD_RECOVERY] Session: ILUIWU
[20:38:30] [UPLOAD_RECOVERY] ✅ No stuck uploads found
[20:38:30] [UPLOAD_RECOVERY] Checking recent media messages on server...
[20:38:30] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18173, file=c8e574003511e75a.jpg, upload_status=complete
[20:38:30] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18171, file=6881a683a964b6bf.heic, upload_status=complete
[20:38:30] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18159, file=d709f7e2335b9796.jpeg, upload_status=complete
[20:38:30] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18127, file=62b393a353b38c70.jpg, upload_status=complete
[20:38:30] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18117, file=ca2813d190665dd2.jpg, upload_status=complete
[20:38:30] [UPLOAD_RECOVERY] Verifying 5 media files exist on server...
[20:38:30] [PENDING_UPLOAD] Total pending upload messages: 0
[20:38:30] [UNSENT_RETRY] No unsent messages found
[20:38:30] [WS] WebSocket ACTUALLY OPENED - isQueryOnly=true, connectionStr=iosILUIWU
[20:38:30] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[20:38:30] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[20:38:30] Token POST → https://crivello.dyndns.org:443/WebRTC/public/new_session.php?sid=iosILUIWU
[20:38:30] DOWNLOADIIING 2360d0215b6a2ab2.mov
[20:38:30] [UPLOAD_RECOVERY] ✅ All media files verified on server
[20:38:30] new_session POST ok: token len=157
[20:38:30] HELLO → sent (fetched token, role=query)
[20:38:30] [SIG] hello_ok received for query connection - ready to query agents
[20:38:30] [SIG] get_agents request sent for sessionId=ILUIWU
[20:38:30] [SIG] get_agents request sent for sessionId=iosILUIWU
[20:38:30] [SERVER] Stopped reconnect polling
[20:38:30] [SIG] agents_list received: []
[20:38:30] [SIG] agents_list received: []
[20:38:30] [COMBINED_FETCH] Loaded 6947 read receipts, 840 messages with reactions
[20:38:30] [READBY_ENRICH] Enriched 50 messages with readBy data
[20:38:31] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18131, 18132, 18133, 18134, 18135]
[20:38:31] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:38:31] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:38:31] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:38:31] [PUSH] Silent push received
[20:38:31] [PUSH_EMBED] No embedded message_data in notification
[20:38:31] [PUSH] No embedded data, pre-loading messages from server
[20:38:31] [PUSH_PRELOAD] Fetching messages for instant display cache
[20:38:31] [PUSH] Silent push received
[20:38:31] [PUSH_EMBED] No embedded message_data in notification
[20:38:31] [PUSH] No embedded data, pre-loading messages from server
[20:38:31] [PUSH_PRELOAD] Fetching messages for instant display cache
[20:38:31] [PUSH] Silent push received
[20:38:31] [PUSH_EMBED] No embedded message_data in notification
[20:38:31] [PUSH] No embedded data, pre-loading messages from server
[20:38:31] [PUSH_PRELOAD] Fetching messages for instant display cache
[20:38:31] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[20:38:31] [PUSH_PRELOAD] ⚡ Pre-cached 50 messages for instant display (preserved 0 from push)
[20:38:31] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[20:38:31] [PUSH_PRELOAD] ⚡ Pre-cached 50 messages for instant display (preserved 0 from push)
[20:38:31] [PUSH_PRELOAD] Fetched 50 messages - caching for instant display
[20:38:32] [PUSH_PRELOAD] ⚡ Pre-cached 50 messages for instant display (preserved 0 from push)
[20:38:32] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[20:38:32] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[20:38:32] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("session_id"): ILUIWU, AnyHashable("message_id"): 18179, AnyHashable("operation_type"): 3]
[20:38:32] [PUSH] Parsed message_id: 18179
[20:38:32] [PUSH] Parsed operation_type: 3
[20:38:32] [PUSH] Taking direct action: opType=3, messageId=18179
[20:38:32] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18179
[20:38:32] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("message_id"): 18178, AnyHashable("session_id"): ILUIWU, AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("operation_type"): 3]
[20:38:32] [PUSH] Parsed message_id: 18178
[20:38:32] [PUSH] Parsed operation_type: 3
[20:38:32] [PUSH] Taking direct action: opType=3, messageId=18178
[20:38:32] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18178
[20:38:32] [PUSH_PRELOAD] ✅ Pre-load complete with thumbnails
[20:38:32] [PUSH] handlePollEventsNotification userInfo: [AnyHashable("aps"): {
"content-available" = 1;
}, AnyHashable("operation_type"): 3, AnyHashable("message_id"): 18180, AnyHashable("session_id"): ILUIWU]
[20:38:32] [PUSH] Parsed message_id: 18180
[20:38:32] [PUSH] Parsed operation_type: 3
[20:38:32] [PUSH] Taking direct action: opType=3, messageId=18180
[20:38:32] [PUSH] TakeActionFromPush called: OperationType=3, MessageIds=18180
[20:38:32] [CLIENT_SIG] Event received: type=3 messageId=18178
[20:38:32] [WS_EVENT] Received event: type=3, messageId=18178
[20:38:32] [WS_EVENT] Read receipt for message 18178 by Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:38:32] [CLIENT_SIG] Event received: type=3 messageId=18179
[20:38:32] [WS_EVENT] Received event: type=3, messageId=18179
[20:38:32] [WS_EVENT] Read receipt for message 18179 by Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:38:32] [CLIENT_SIG] Event received: type=3 messageId=18180
[20:38:32] [WS_EVENT] Received event: type=3, messageId=18180
[20:38:32] [WS_EVENT] Read receipt for message 18180 by Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:38:35] [MENU] dismissAnyExistingMenu called
[20:38:35] [MENU] dismissAnyExistingMenu completed
[20:38:35] [EMOJI_PICKER] Starting emoji picker for message 18178
[20:38:35] [MENU] Created button 'Reply' at index 0
[20:38:35] [MENU] Created button 'Copy' at index 1
[20:38:35] [MENU] Created button 'Delete' at index 2
[20:38:35] [MENU] Menu added at y=528.5
[20:38:35] [EMOJI_PICKER] ✅ Fetched 6 recent emojis
[20:38:35] [EMOJI_PICKER] ✅ Creating picker with 6 recent emojis
[20:38:35] [EMOJI_PICKER] ✅ Picker shown at y=347.5
[20:38:36] [MENU] menuButtonTouchDown - button title: Reply, tag: 0
[20:38:36] [MENU] menuButtonTapped - button title: Reply, tag: 0
[20:38:36] [MENU] Button frame: (0.0, 0.0, 120.0, 44.0), superview: true
[20:38:36] [MENU] Found action closure, dismissing menu first
[20:38:36] [MENU] dismissAnyExistingMenu called
[20:38:36] [MENU] Found menu with tag 9999, removing
[20:38:36] [MENU] Removing blur effect
[20:38:36] [MENU] Removing floating message snapshot
[20:38:36] [MENU] Dismissing emoji picker
[20:38:36] [MENU] Recorded dismissal time for debounce
[20:38:36] [MENU] dismissAnyExistingMenu completed
[20:38:36] [MENU] Menu dismissed, executing action
[20:38:36] [REPLY_DEBUG] ✅ startReplyTo called - set messageToReplyTo to message 18178
[20:38:36] [MENU] Action executed
[20:38:36] [SCROLL_BTN] Showing button - 310pt from bottom > half 223pt
[20:38:43] [MENU] dismissAnyExistingMenu called
[20:38:43] [MENU] dismissAnyExistingMenu completed
[20:38:48] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:38:48] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:38:48] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:38:49] [SCROLL_BTN] Showing button - 310pt from bottom > half 223pt
[20:38:50] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:38:50] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:38:50] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:38:52] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[20:38:52] [SCROLL_BTN] Showing button - 307pt from bottom > half 223pt
[20:39:01] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[20:39:01] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=50, isReloading=false
[20:39:01] [SEND_MESSAGE] ✅ Added optimistic message id=-1 to arrays, newMsgCount=51
[20:39:01] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[-1, 18180, 18179, 18178, 18177]
[20:39:01] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[20:39:01] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[20:39:02] [LIFECYCLE] App resigning active - cleared crash flag
[20:39:02] [SECURITY] sceneDidEnterBackground - isAuthenticated=true
[20:39:02] [SECURITY] Saved background timestamp
[20:39:02] [LIFECYCLE] App entering background - cleared crash flag
[20:39:02] [CLIENT_SIG] Disconnecting
[20:39:02] [LIFECYCLE] App entering background - disconnecting connections and stopping audio
[20:39:02] [WS] stopSignalingAndPeer called - isQueryOnly=true, connectionStr=iosILUIWU, wsState=0
[20:39:02] [WS] Canceling WebSocket for query connection to iosILUIWU
[20:39:02] In cleanupPeer
[20:39:02] In cleanupPeer
[20:39:02] [LIFECYCLE] WebRTC audio disabled
[20:39:02] [LIFECYCLE] AVAudioSession deactivated
[20:39:02] [LIFECYCLE] All connections stopped
[20:39:03] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18181,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 19:39:01"}
[20:39:03] [CHAT] receive_message.php JSON: ["datesent_utc": 2026-01-18 19:39:01, "message_type": 0, "ok": 1, "message_id": 18181, "session_id": ILUIWU, "file_name": ]
[20:39:03] [DB_UPGRADE] Upgrading message ID: -1 → 18181, preserveOriginalDate=false
[20:39:03] [DB_UPGRADE] ✅ Upgraded -1 → 18181 with send_status=0, 1 row(s) affected
[20:39:03] [CLIENT_SIG] WebSocket closed with code 1001
[20:39:03] [CLIENT_SIG] Reconnecting in 2.0s (attempt 1)
[20:39:03] [SERVER] Stopped reconnect polling
[20:39:03] Will request stop of video 0
[20:39:03] Will request stop of video 0
[20:39:03] [WS] WebSocket task completed with error - isQueryOnly=true: cancelled
[20:39:03] [WS] Query connection error - cleaning up all agent connections and views
[20:39:03] [WS] Connection failed: The operation couldn’t be completed. Socket is not connected
[20:39:03] [WS] Query connection failed - cleaning up all agent connections and views
[20:39:03] [CLIENT_SIG] Receive error: Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo={NSErrorFailingURLStringKey=http://crivello.dyndns.org:8081/, NSErrorFailingURLKey=http://crivello.dyndns.org:8081/}
[20:39:03] [CLIENT_SIG] Reconnecting in 4.0s (attempt 2)
[20:39:03] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -1 → 18181
[20:39:03] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -1 → 18181
[20:39:03] ReloadData 9
[20:39:03] [PIP] Removing 0 tracks from PiP for connection 0
[20:39:03] [PIP] ✅ All tracks removed for connection 0
[20:39:03] [PIP] Removing 0 tracks from PiP for connection 0
[20:39:03] [PIP] ✅ All tracks removed for connection 0
[20:39:03] [CLEANUP] ========================================
[20:39:03] [CLEANUP] Cleaning up all agent connections and views
[20:39:03] [CLEANUP] Current state: vccs=0, videoViews=0, feedScrollViews=0
[20:39:03] [CLEANUP] Stopped and removed 0 video connections
[20:39:03] [CLEANUP] Removed 0 video views
[20:39:03] [CLEANUP] Removed 0 feed scroll views
[20:39:03] [CLEANUP] Removed 0 status labels
[20:39:03] [CLEANUP] Reset agent query state
[20:39:03] [CLEANUP] Updated page indicator
[20:39:03] [CLEANUP] Rebuilt video layout
[20:39:03] [CLEANUP] ✅ All agent connections and views cleaned up
[20:39:03] [CLEANUP] ========================================
[20:39:03] [SERVER] Skipping reconnect polling - app is in background
[20:39:03] [WS] URLSession invalidated successfully
[20:39:03] [CLEANUP] ========================================
[20:39:03] [CLEANUP] Cleaning up all agent connections and views
[20:39:03] [CLEANUP] Current state: vccs=0, videoViews=0, feedScrollViews=0
[20:39:03] [CLEANUP] Stopped and removed 0 video connections
[20:39:03] [CLEANUP] Removed 0 video views
[20:39:03] [CLEANUP] Removed 0 feed scroll views
[20:39:03] [CLEANUP] Removed 0 status labels
[20:39:03] [CLEANUP] Reset agent query state
[20:39:03] [CLEANUP] Updated page indicator
[20:39:03] [CLEANUP] Rebuilt video layout
[20:39:03] [CLEANUP] ✅ All agent connections and views cleaned up
[20:39:03] [CLEANUP] ========================================
[20:39:03] [SERVER] Skipping reconnect polling - app is in background
[20:42:08] [SECURITY] Timeout check: elapsed=185.2872462272644s, timeout=300.0s
[20:42:08] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[20:42:08] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:42:08] [LIFECYCLE] App entering foreground - restoring connections
[20:42:08] [LIFECYCLE] Away > 2 minutes (185s) - will scroll to bottom
[20:42:08] [UPLOAD_RETRY] No pending uploads to retry
[20:42:08] [LIFECYCLE] Merged 841 reactions from local DB
[20:42:08] [LIFECYCLE] WebRTC audio re-enabled
[20:42:08] [AUDIO] ✅ Chat mode - audio will be managed by WebRTCViewer (no microphone)
[20:42:08] [CLIENT_SIG] Setting up client signaling for session: ILUIWU
[20:42:08] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[20:42:08] [VIEWER] Reconnecting after background - querying agents
[20:42:08] [UNSENT_RETRY] Checking for unsent messages...
[20:42:08] [PENDING_UPLOAD] Total pending upload messages: 0
[20:42:08] [UNSENT_RETRY] No unsent messages found
[20:42:08] [WS] Creating new WebSocket - isQueryOnly=true, connectionStr=iosILUIWU
[20:42:08] [WS] Opening session at ws://crivello.dyndns.org:8081/
[20:42:08] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[20:42:08] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[18181, 18180, 18179, 18178, 18177]
[20:42:08] DOWNLOADIIING 2360d0215b6a2ab2.mov
[20:42:08] [CLIENT_SIG] WebSocket opened
[20:42:08] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[20:42:08] [CLIENT_SIG] Connected! clientId=PxlCUhG3idNU_4Pa
[20:42:08] [CLIENT_SIG] Received 1 clients for session 'ILUIWU' (my session: 'ILUIWU')
[20:42:08] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:42:08] [WS] WebSocket ACTUALLY OPENED - isQueryOnly=true, connectionStr=iosILUIWU
[20:42:08] HELLO → sent (cached token, role=query)
[20:42:08] [SIG] hello_ok received for query connection - ready to query agents
[20:42:08] [SIG] get_agents request sent for sessionId=ILUIWU
[20:42:08] [SIG] get_agents request sent for sessionId=iosILUIWU
[20:42:08] [SERVER] Stopped reconnect polling
[20:42:08] [SIG] agents_list received: []
[20:42:08] [SIG] agents_list received: []
[20:42:08] [SECURITY] sceneDidBecomeActive - isAuthenticated=true, didEnterBackground=true
[20:42:08] [SECURITY] Within timeout - cleared background flag
[20:42:08] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:42:08] [PUSH] handlePollEventsNotification userInfo: [:]
[20:42:08] [PUSH] No message_id in userInfo
[20:42:08] [PUSH] No operation_type in userInfo
[20:42:08] [FAST_REFRESH] Evolution disabled - performing incremental sync
[20:42:08] [FAST_REFRESH] Already have 51 messages - skipping local DB load
[20:42:08] [FAST_REFRESH] About to call reloadMessagesForCurrentTab(), isMainThread=true, viewLoaded=true
[20:42:08] [FAST_REFRESH] reloadMessagesForCurrentTab() called successfully
[20:42:08] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=51
[20:42:08] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18181
[20:42:08] [INCREMENTAL_SYNC] ✅ No new messages
[20:42:08] [FAST_REFRESH] Incremental sync complete - 51 messages
[20:42:08] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[18181, 18180, 18179, 18178, 18177]
[20:42:08] [COMBINED_FETCH] Loaded 6948 read receipts, 840 messages with reactions
[20:42:08] [FOREGROUND] Enriched 0 messages with readBy data from server
[20:42:09] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[18181, 18180, 18179, 18178, 18177]
[20:42:09] [COMBINED_FETCH] Loaded 6948 read receipts, 840 messages with reactions
[20:42:09] [FAST_REFRESH] Enriched 51 messages with readBy data
[20:42:09] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[18181, 18180, 18179, 18178, 18177]
[20:42:18] [WS] WebSocket task completed with error - isQueryOnly=true: The request timed out.
[20:42:18] [WS] Query connection error - cleaning up all agent connections and views
[20:42:18] [CLEANUP] ========================================
[20:42:18] [CLEANUP] Cleaning up all agent connections and views
[20:42:18] [CLEANUP] Current state: vccs=0, videoViews=0, feedScrollViews=0
[20:42:18] [CLEANUP] Stopped and removed 0 video connections
[20:42:18] [CLEANUP] Removed 0 video views
[20:42:18] [CLEANUP] Removed 0 feed scroll views
[20:42:18] [CLEANUP] Removed 0 status labels
[20:42:18] [CLEANUP] Reset agent query state
[20:42:18] [CLEANUP] Updated page indicator
[20:42:18] [CLEANUP] Rebuilt video layout
[20:42:18] [CLEANUP] ✅ All agent connections and views cleaned up
[20:42:18] [CLEANUP] ========================================
[20:42:18] [SERVER] Starting reconnect polling (5s interval)
[20:42:23] [SERVER] Polling - attempting to reconnect...
[20:42:23] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[20:42:23] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=51, isReloading=false
[20:42:23] [SEND_MESSAGE] ✅ Added optimistic message id=-2 to arrays, newMsgCount=52
[20:42:23] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=52, first5Ids=[-2, 18181, 18180, 18179, 18178]
[20:42:23] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[20:42:23] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[20:42:24] [CLIENT_SIG] Event received: type=0 messageId=18182
[20:42:24] [WS_EVENT] Received event: type=0, messageId=18182
[20:42:24] [WS_EVENT] 📨 New message notification (msgId=18182) - triggering incremental refresh, currentMsgCount=52
[20:42:24] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=52
[20:42:24] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18181
[20:42:24] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18182,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 19:42:23"}
[20:42:24] [CHAT] receive_message.php JSON: ["ok": 1, "message_type": 0, "datesent_utc": 2026-01-18 19:42:23, "session_id": ILUIWU, "message_id": 18182, "file_name": ]
[20:42:24] [DB_UPGRADE] Upgrading message ID: -2 → 18182, preserveOriginalDate=false
[20:42:24] [DB_UPGRADE] ✅ Upgraded -2 → 18182 with send_status=0, 1 row(s) affected
[20:42:24] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -2 → 18182
[20:42:24] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -2 → 18182
[20:42:24] ReloadData 9
[20:42:24] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[20:42:25] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[20:42:25] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=52
[20:42:25] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=52, first5Ids=[18131, 18132, 18133, 18134, 18135]
[20:42:28] [SERVER] Polling - attempting to reconnect...
[20:42:33] [SERVER] Polling - attempting to reconnect...
[20:42:38] [SERVER] Polling - attempting to reconnect...
[20:42:39] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[20:42:39] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=52, isReloading=false
[20:42:39] [SEND_MESSAGE] ✅ Added optimistic message id=-3 to arrays, newMsgCount=53
[20:42:39] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=53, first5Ids=[-3, 18182, 18181, 18180, 18179]
[20:42:39] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[20:42:39] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[20:42:41] [CLIENT_SIG] Event received: type=0 messageId=18183
[20:42:41] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18183,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 19:42:39"}
[20:42:41] [WS_EVENT] Received event: type=0, messageId=18183
[20:42:41] [WS_EVENT] 📨 New message notification (msgId=18183) - triggering incremental refresh, currentMsgCount=53
[20:42:41] [CHAT] receive_message.php JSON: ["ok": 1, "datesent_utc": 2026-01-18 19:42:39, "message_type": 0, "message_id": 18183, "file_name": , "session_id": ILUIWU]
[20:42:41] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=53
[20:42:41] [DB_UPGRADE] Upgrading message ID: -3 → 18183, preserveOriginalDate=false
[20:42:41] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18182
[20:42:41] [DB_UPGRADE] ✅ Upgraded -3 → 18183 with send_status=0, 1 row(s) affected
[20:42:41] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -3 → 18183
[20:42:41] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -3 → 18183
[20:42:41] ReloadData 9
[20:42:41] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[20:42:41] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[20:42:41] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=53
[20:42:41] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=53, first5Ids=[18131, 18132, 18133, 18134, 18135]
[20:42:42] [LOCK] Lock button tapped - locking app immediately
[20:42:42] [LOCK] Received lock app notification
[20:42:42] [LIFECYCLE] App resigning active - cleared crash flag
[20:42:43] [SERVER] Polling - attempting to reconnect...
[20:42:43] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[20:42:43] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:42:43] [PUSH] handlePollEventsNotification userInfo: [:]
[20:42:43] [PUSH] No message_id in userInfo
[20:42:43] [PUSH] No operation_type in userInfo
[20:42:43] [FAST_REFRESH] Evolution disabled - performing incremental sync
[20:42:43] [FAST_REFRESH] Already have 53 messages - skipping local DB load
[20:42:43] [FAST_REFRESH] About to call reloadMessagesForCurrentTab(), isMainThread=true, viewLoaded=true
[20:42:43] [FAST_REFRESH] reloadMessagesForCurrentTab() called successfully
[20:42:43] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=53
[20:42:43] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18183
[20:42:44] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=53, first5Ids=[18131, 18132, 18133, 18134, 18135]
[20:42:44] [INCREMENTAL_SYNC] ✅ No new messages
[20:42:44] [FAST_REFRESH] Incremental sync complete - 53 messages
[20:42:44] [COMBINED_FETCH] Loaded 6950 read receipts, 840 messages with reactions
[20:42:44] [FAST_REFRESH] Enriched 53 messages with readBy data
[20:42:44] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=53, first5Ids=[18131, 18132, 18133, 18134, 18135]
[20:42:45] [PIN_AUTH] Correct PIN
[20:42:45] [SECURITY] Restored real session: ILUIWU
[20:42:45] [SECURITY] Restored real session: ILUIWU
[20:42:46] [LOCK] ✅ PIN auth callback - setting isAuthenticated = true
[20:42:46] [AUTH] Authentication completed - updating UI only (data already fetched in foreground handler)
[20:42:46] [AUTH] Cache had 50 messages, maxExistingId=18183, inserted 0 truly new
[20:42:46] [AUTH] UI update complete
[20:42:46] [FAKE MODE] Exiting fake mode, restoring real session
[20:42:46] [SECURITY] Restored real session: ILUIWU
[20:42:46] [SECURITY] Saved real session: ILUIWU
[20:42:46] [FAKE MODE] ✅ Restored real session: ILUIWU
[20:42:46] [FAKE MODE] Loaded 50 messages (limited to page size)
[20:42:46] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[20:42:46] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:42:46] [USER] ✅ User registered successfully
[20:42:46] [PUSH] User registration after token update: success
[20:42:46] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18134, 18135, 18136, 18137, 18138]
[20:42:48] [SERVER] Polling - attempting to reconnect...
[20:42:52] [REPLY_DEBUG] 📤 didTapSend - Sending message WITHOUT reply
[20:42:52] [SEND_MESSAGE] 📤 Sending message, currentMsgCount=50, isReloading=false
[20:42:52] [SEND_MESSAGE] ✅ Added optimistic message id=-4 to arrays, newMsgCount=51
[20:42:52] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[-4, 18183, 18182, 18181, 18180]
[20:42:52] [REPLY_DEBUG] ❌ cancelReply called - clearing messageToReplyTo
[20:42:52] [REPLY_DEBUG] ⚠️ sendMessage HTTP BODY - No reply message captured
[20:42:53] [SERVER] Polling - attempting to reconnect...
[20:42:53] [LOCK] Lock button tapped - locking app immediately
[20:42:53] [LOCK] Received lock app notification
[20:42:54] [LIFECYCLE] App resigning active - cleared crash flag
[20:42:54] [CLIENT_SIG] Event received: type=0 messageId=18184
[20:42:54] [WS_EVENT] Received event: type=0, messageId=18184
[20:42:54] [CHAT] receive_message.php HTTP 200: {"ok":true,"message_id":18184,"session_id":"ILUIWU","message_type":0,"file_name":"","datesent_utc":"2026-01-18 19:42:53"}
[20:42:54] [WS_EVENT] 📨 New message notification (msgId=18184) - triggering incremental refresh, currentMsgCount=51
[20:42:54] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=51
[20:42:54] [CHAT] receive_message.php JSON: ["session_id": ILUIWU, "file_name": , "message_id": 18184, "message_type": 0, "ok": 1, "datesent_utc": 2026-01-18 19:42:53]
[20:42:54] [DB_UPGRADE] Upgrading message ID: -4 → 18184, preserveOriginalDate=false
[20:42:54] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18183
[20:42:54] [DB_UPGRADE] ✅ Upgraded -4 → 18184 with send_status=0, 1 row(s) affected
[20:42:54] [SEND_UPGRADE] ✅ Updated chatMessages[0].id: -4 → 18184
[20:42:54] [SEND_UPGRADE] ✅ Updated allMessagesWithReadBy[0].id: -4 → 18184
[20:42:54] ReloadData 9
[20:42:54] [INCREMENTAL_SYNC] ✅ Found 1 new messages
[20:42:54] [BLACKOUT_DEBUG] blackoutView=nil, newMessages.count=1
[20:42:54] [WS_EVENT] ✅ Incremental refresh complete, newMsgCount=51
[20:42:54] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=51, first5Ids=[18134, 18135, 18136, 18137, 18138]
[20:42:54] [SECURITY] sceneDidEnterBackground - isAuthenticated=false
[20:42:54] [SECURITY] ⚠️ NOT saving timestamp - isAuthenticated is false
[20:42:54] [LIFECYCLE] App entering background - cleared crash flag
[20:42:54] [CLIENT_SIG] Disconnecting
[20:42:54] [LIFECYCLE] App entering background - disconnecting connections and stopping audio
[20:42:54] [WS] stopSignalingAndPeer called - isQueryOnly=true, connectionStr=iosILUIWU, wsState=3
[20:42:54] [WS] Canceling WebSocket for query connection to iosILUIWU
[20:42:54] In cleanupPeer
[20:42:54] In cleanupPeer
[20:42:54] [LIFECYCLE] WebRTC audio disabled
[20:42:54] [LIFECYCLE] AVAudioSession deactivated
[20:42:54] [LIFECYCLE] All connections stopped
[20:42:54] [CLIENT_SIG] WebSocket closed with code 1001
[20:42:54] [CLIENT_SIG] Reconnecting in 2.0s (attempt 1)
[20:42:54] [CLIENT_SIG] Receive error: Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo={NSErrorFailingURLStringKey=http://crivello.dyndns.org:8081/, NSErrorFailingURLKey=http://crivello.dyndns.org:8081/}
[20:42:54] [CLIENT_SIG] Reconnecting in 4.0s (attempt 2)
[20:42:54] [SERVER] Stopped reconnect polling
[20:42:54] [WS] URLSession invalidated successfully
[20:42:54] Will request stop of video 0
[20:42:54] Will request stop of video 0
[20:49:55] [CRASH] No crash detected
[20:49:55] [FONT] Roboto fonts loaded successfully: Roboto-Regular
[20:49:55] [FONT] ChatFont.regular(18) returns: Roboto-Regular, family: Roboto
[20:49:55] [GIPHY] SDK not available - using REST API fallback
[20:49:55] [BACKGROUND] Background fetch enabled
[20:49:55] [AUTH] Starting PIN authentication
[20:49:55] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[20:49:55] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:49:55] [CLEANUP] No old timer messages to delete
[20:49:55] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[20:49:55] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:49:55] [PUSH] APNs token: 6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c
[20:49:55] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[20:49:55] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:49:55] [USER] ✅ User registered successfully
[20:49:55] [PUSH] User registration after token update: success
[20:49:55] [PRELOAD] ⚡ Starting message pre-load during authentication (since_id=18184)...
[20:49:55] [CLIENT_SIG] WebSocket opened
[20:49:55] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[20:49:55] [CLIENT_SIG] Connected! clientId=e0eqJ_dMDWktjXJ6
[20:49:55] [CLIENT_SIG] Received 1 clients for session 'ILUIWU' (my session: 'ILUIWU')
[20:49:55] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:49:55] [PRELOAD] No messages or parse error
[20:50:27] [CRASH] Previous session did not exit cleanly - crash detected
[20:50:27] [FONT] Roboto fonts loaded successfully: Roboto-Regular
[20:50:27] [FONT] ChatFont.regular(18) returns: Roboto-Regular, family: Roboto
[20:50:27] [GIPHY] SDK not available - using REST API fallback
[20:50:27] [BACKGROUND] Background fetch enabled
[20:50:27] [AUTH] Starting PIN authentication
[20:50:27] [CLEANUP] No old timer messages to delete
[20:50:27] [BACKGROUND] Background fetch triggered
[20:50:27] [BACKGROUND] Fetching recent messages for pre-cache
[20:50:27] [PUSH] APNs token: 6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c
[20:50:27] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[20:50:27] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:50:27] [BACKGROUND] Fetched 50 messages - saving to DB and pre-caching
[20:50:27] [PRELOAD] ⚡ Starting message pre-load during authentication (since_id=18184)...
[20:50:27] [BACKGROUND] Pre-cached 50 ChatMessage objects for instant display (preserved 0 from push)
[20:50:27] [USER] ✅ User registered successfully
[20:50:27] [PUSH] User registration after token update: success
[20:50:27] [PRELOAD] No messages or parse error
[20:50:27] [BACKGROUND] Pre-downloaded 0 thumbnails
[20:50:27] [BACKGROUND] ✅ Background fetch complete with thumbnail pre-download
[20:51:07] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[20:51:07] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:51:08] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[20:51:08] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:51:08] [CLIENT_SIG] WebSocket opened
[20:51:08] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[20:51:08] [CLIENT_SIG] Connected! clientId=FXKDsIcDsiZpmAhd
[20:51:08] [CLIENT_SIG] Received 1 clients for session 'ILUIWU' (my session: 'ILUIWU')
[20:51:08] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:51:09] [PIN_AUTH] Correct PIN
[20:51:09] [SECURITY] Restored real session: ILUIWU
[20:51:09] [SECURITY] Restored real session: ILUIWU
[20:51:09] [SECURITY] Saved real session: ILUIWU
[20:51:09] [SCENE] Launched directly to chat view with sessionId: ILUIWU
[20:51:09] [AUDIO] ✅ Chat mode - audio will be managed by WebRTCViewer (no microphone)
[20:51:09] Documents Directory: /var/mobile/Containers/Data/Application/ACF1B6EF-8F63-4821-A2F3-E2037EA4C87B/Documents
[20:51:09] [UPLOAD_QUEUE] Found 0 pending uploads to resume
[20:51:09] [THEME] Applying current theme
[20:51:09] [CHAT] Applied day theme (mode: day)
[20:51:09] [SECURITY] Saved real session: ILUIWU
[20:51:09] [CLIENT_SIG] Setting up client signaling for session: ILUIWU
[20:51:09] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[20:51:09] [NETWORK] Network monitor started
[20:51:09] [NETWORK] Status changed: connected
[20:51:09] Did transition
[20:51:09] [MODE] 🔍 updateModeUI called - currentTabIndex=0, sessionId=ILUIWU
[20:51:09] [VIEWER] Screen lock enabled - normal idle behavior
[20:51:09] [QUERY] 🔍 Creating query connection for iOS slave: iosILUIWU
[20:51:09] [VCC] ========== VideoConnectionClass INIT ==========
[20:51:09] [VCC] Session: iosILUIWU, ViewIdx: 0, AgentId: nil
[20:51:09] [DATA AUDIO] ========== setupWebRTC() START ==========
[20:51:09] [DATA AUDIO] Using data channel for audio - bypassing WebRTC audio device
[20:51:09] [DATA AUDIO] Creating encoder/decoder factories...
[20:51:09] [CODEC] Viewer - Available video codecs: H264, H264, VP8, VP9, AV1
[20:51:09] [CODEC] Viewer selected encoder: AV1 (best quality)
[20:51:09] [DATA AUDIO] Creating RTCPeerConnectionFactory...
[20:51:09] [DATA AUDIO] ✅ Factory created
[20:51:09] [DATA AUDIO] RTCAudioSession locked
[20:51:09] [DATA AUDIO] Set useManualAudio=true, isAudioEnabled=false
[20:51:09] [DATA AUDIO] RTCAudioSession unlocked
[20:51:09] [DATA AUDIO] Skipping AVAudioSession config - handled by DataChannelAudioPlayer
[20:51:09] [VCC] Initial ICE servers: ["stun:stun.l.google.com:19302", "turn:crivello.dyndns.org:3478?transport=udp", "turn:crivello.dyndns.org:3478?transport=tcp", "turns:crivello.dyndns.org:5349?transport=tcp"]
[20:51:09] [WS] Creating new WebSocket - isQueryOnly=false, connectionStr=iosILUIWU
[20:51:09] [WS] Opening session at ws://crivello.dyndns.org:8081/
[20:51:09] [QUERY] ✅ tempQueryConnection created for iosILUIWU
[20:51:09] [VIEWER_INIT] Already have 50 messages - just filtering for tab
[20:51:09] [EVENT_POLL] Event polling disabled - using WebSocket events instead
[20:51:09] [ORIENTATION] Updated pagingScrollView height to 247.5 for width 440.0
[20:51:09] Did transition
[20:51:09] [TABLEVIEW] cellForRowAt index 0 out of bounds (count=0)
[20:51:09] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:51:09] [CHUNK] Merged 841 reactions synchronously
[20:51:09] [RELOAD_TAB] ⏳ Already pending, waiting for debounce
[20:51:09] [GALLERY_DB] Loading ALL media messages for session: ILUIWU
[20:51:09] [MIGRATION] No messages need sender_name backfill
[20:51:09] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[20:51:09] [GALLERY_DB] Raw datesent for msg 18173: '2026-01-18 18:37:42'
[20:51:09] [GALLERY_DB] Raw datesent for msg 18171: '2026-01-18 18:36:13'
[20:51:09] [GALLERY_DB] Raw datesent for msg 18162: '2026-01-18 10:37:29'
[20:51:10] [GALLERY_DB] ✅ Loaded 452 media messages
[20:51:10] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18184
[20:51:10] [GALLERY] Filtered 452 -> 413 (only with local thumbnails)
[20:51:10] [GALLERY] First 5 after sort (newest first):
[20:51:10] [GALLERY] 0: id=18173, date=2026-01-18 18:37:42, file=c8e574003511e75a.jpg
[20:51:10] [GALLERY] 1: id=18171, date=2026-01-18 18:36:13, file=6881a683a964b6bf.heic
[20:51:10] [GALLERY] 2: id=18162, date=2026-01-18 10:37:29, file=2360d0215b6a2ab2.mov
[20:51:10] [GALLERY] 3: id=18161, date=2026-01-18 10:36:56, file=399b07f80d99b3ff.heic
[20:51:10] [GALLERY] 4: id=18159, date=2026-01-18 10:17:19, file=d709f7e2335b9796.jpeg
[20:51:10] [SCROLL_BTN] Showing button - 32pt from bottom > half 22pt
[20:51:10] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:10] [EMOJI] ✅ Loaded 451 emoji-to-GIF mappings
[20:51:10] [USER] ✅ User registered successfully
[20:51:10] [USER] User registration successful
[20:51:10] [SERVER] Starting reconnect polling (5s interval)
[20:51:10] [ICONS] Screen width: 440.0, Tab spacing: 75.5
[20:51:10] [ICONS] Offset applied: -14.6
[20:51:10] [ICONS] New left margin: 11.2, New right margin: 11.3
[20:51:10] [ICONS] Chat center: (31.2, 87.0)
[20:51:10] [ICONS] Gallery center: (106.7, 87.0), deltaX: 75.5
[20:51:10] [ICONS] Camera center: (182.2, 87.0), deltaX: 75.5
[20:51:10] [ICONS] Settings center: (257.7, 87.0), deltaX: 75.5
[20:51:10] [ICONS] Lock centerX: 333.2, deltaX from Settings: 75.5
[20:51:10] [ICONS] Bell centerX: 408.7, deltaX from Lock: 75.5
[20:51:10] [ICONS] LEFT MARGIN (screen left to Chat left): 11.2
[20:51:10] [ICONS] RIGHT MARGIN (Bell right to screen right): 11.3
[20:51:10] [ICONS] Screen width: 440.0
[20:51:10] DOWNLOADIIING 2360d0215b6a2ab2.mov
[20:51:10] [WS] WebSocket ACTUALLY OPENED - isQueryOnly=true, connectionStr=iosILUIWU
[20:51:10] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[20:51:10] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[20:51:10] Token POST → https://crivello.dyndns.org:443/WebRTC/public/new_session.php?sid=iosILUIWU
[20:51:10] new_session POST ok: token len=157
[20:51:10] HELLO → sent (fetched token, role=query)
[20:51:10] [SIG] hello_ok received for query connection - ready to query agents
[20:51:10] [SIG] get_agents request sent for sessionId=ILUIWU
[20:51:10] [SIG] get_agents request sent for sessionId=iosILUIWU
[20:51:10] [SERVER] Stopped reconnect polling
[20:51:10] [SIG] agents_list received: []
[20:51:10] [SIG] agents_list received: []
[20:51:10] [INCREMENTAL_SYNC] ✅ No new messages
[20:51:10] [PURGE] ⚠️ Media cache purge DISABLED for debugging
[20:51:10] [UNSENT_RETRY] Checking for unsent messages...
[20:51:10] [UPLOAD_RECOVERY] ========== CHECKING FOR MISSING UPLOADS ==========
[20:51:10] [UPLOAD_RECOVERY] User ID: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF
[20:51:10] [UPLOAD_RECOVERY] Session: ILUIWU
[20:51:10] [UPLOAD_RECOVERY] ✅ No stuck uploads found
[20:51:10] [UPLOAD_RECOVERY] Checking recent media messages on server...
[20:51:10] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18173, file=c8e574003511e75a.jpg, upload_status=complete
[20:51:10] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18171, file=6881a683a964b6bf.heic, upload_status=complete
[20:51:10] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18159, file=d709f7e2335b9796.jpeg, upload_status=complete
[20:51:10] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18127, file=62b393a353b38c70.jpg, upload_status=complete
[20:51:10] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18117, file=ca2813d190665dd2.jpg, upload_status=complete
[20:51:10] [UPLOAD_RECOVERY] Verifying 5 media files exist on server...
[20:51:10] [PENDING_UPLOAD] Total pending upload messages: 0
[20:51:10] [UNSENT_RETRY] No unsent messages found
[20:51:10] [UPLOAD_RECOVERY] ✅ All media files verified on server
[20:51:10] [COMBINED_FETCH] Loaded 6951 read receipts, 840 messages with reactions
[20:51:10] [READBY_ENRICH] Enriched 50 messages with readBy data
[20:51:10] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:26] [MENU] dismissAnyExistingMenu called
[20:51:26] [MENU] dismissAnyExistingMenu completed
[20:51:26] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:51:26] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:51:26] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:51:27] [MENU] dismissAnyExistingMenu called
[20:51:27] [MENU] dismissAnyExistingMenu completed
[20:51:31] [LOCK] Lock button tapped - locking app immediately
[20:51:31] [LOCK] Received lock app notification
[20:51:32] [LIFECYCLE] App resigning active - cleared crash flag
[20:51:34] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[20:51:34] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:51:34] [PUSH] handlePollEventsNotification userInfo: [:]
[20:51:34] [PUSH] No message_id in userInfo
[20:51:34] [PUSH] No operation_type in userInfo
[20:51:34] [FAST_REFRESH] Evolution disabled - performing incremental sync
[20:51:34] [FAST_REFRESH] Already have 50 messages - skipping local DB load
[20:51:34] [FAST_REFRESH] About to call reloadMessagesForCurrentTab(), isMainThread=true, viewLoaded=true
[20:51:34] [FAST_REFRESH] reloadMessagesForCurrentTab() called successfully
[20:51:34] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[20:51:34] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18184
[20:51:34] [INCREMENTAL_SYNC] ✅ No new messages
[20:51:34] [FAST_REFRESH] Incremental sync complete - 50 messages
[20:51:34] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:34] [COMBINED_FETCH] Loaded 6951 read receipts, 840 messages with reactions
[20:51:34] [FAST_REFRESH] Enriched 50 messages with readBy data
[20:51:35] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:35] [PIN_AUTH] Correct PIN
[20:51:35] [SECURITY] Restored real session: ILUIWU
[20:51:35] [SECURITY] Restored real session: ILUIWU
[20:51:35] [LOCK] ✅ PIN auth callback - setting isAuthenticated = true
[20:51:35] [AUTH] Authentication completed - updating UI only (data already fetched in foreground handler)
[20:51:35] [AUTH] UI update complete
[20:51:35] [FAKE MODE] Exiting fake mode, restoring real session
[20:51:35] [SECURITY] Restored real session: ILUIWU
[20:51:35] [SECURITY] Saved real session: ILUIWU
[20:51:35] [FAKE MODE] ✅ Restored real session: ILUIWU
[20:51:35] [FAKE MODE] Loaded 50 messages (limited to page size)
[20:51:35] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[20:51:35] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:51:35] [USER] ✅ User registered successfully
[20:51:35] [PUSH] User registration after token update: success
[20:51:35] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:39] [LIFECYCLE] App resigning active - cleared crash flag
[20:51:39] [SECURITY] sceneDidBecomeActive - isAuthenticated=true, didEnterBackground=false
[20:51:39] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:51:39] [PUSH] handlePollEventsNotification userInfo: [:]
[20:51:39] [PUSH] No message_id in userInfo
[20:51:39] [PUSH] No operation_type in userInfo
[20:51:39] [FAST_REFRESH] Evolution disabled - performing incremental sync
[20:51:39] [FAST_REFRESH] Already have 50 messages - skipping local DB load
[20:51:39] [FAST_REFRESH] About to call reloadMessagesForCurrentTab(), isMainThread=true, viewLoaded=true
[20:51:39] [FAST_REFRESH] reloadMessagesForCurrentTab() called successfully
[20:51:39] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[20:51:39] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18184
[20:51:39] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:40] [INCREMENTAL_SYNC] ✅ No new messages
[20:51:40] [FAST_REFRESH] Incremental sync complete - 50 messages
[20:51:40] [LOCK] Lock button tapped - locking app immediately
[20:51:40] [LOCK] Received lock app notification
[20:51:40] [COMBINED_FETCH] Loaded 6951 read receipts, 840 messages with reactions
[20:51:40] [FAST_REFRESH] Enriched 50 messages with readBy data
[20:51:40] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:51:40] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:51:40] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:51:40] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:51:40] [LIFECYCLE] App resigning active - cleared crash flag
[20:51:41] [SECURITY] sceneDidEnterBackground - isAuthenticated=false
[20:51:41] [SECURITY] ⚠️ NOT saving timestamp - isAuthenticated is false
[20:51:41] [LIFECYCLE] App entering background - cleared crash flag
[20:51:41] [CLIENT_SIG] Disconnecting
[20:51:41] [LIFECYCLE] App entering background - disconnecting connections and stopping audio
[20:51:41] [WS] stopSignalingAndPeer called - isQueryOnly=true, connectionStr=iosILUIWU, wsState=0
[20:51:41] [WS] Canceling WebSocket for query connection to iosILUIWU
[20:51:41] In cleanupPeer
[20:51:41] In cleanupPeer
[20:51:41] [LIFECYCLE] WebRTC audio disabled
[20:51:41] [LIFECYCLE] AVAudioSession deactivated
[20:51:41] [LIFECYCLE] All connections stopped
[20:51:41] [SERVER] Stopped reconnect polling
[20:51:41] Will request stop of video 0
[20:51:41] [CLIENT_SIG] WebSocket closed with code 1001
[20:51:41] [CLIENT_SIG] Reconnecting in 2.0s (attempt 1)
[20:51:41] Will request stop of video 0
[20:51:41] [WS] WebSocket ACTUALLY CLOSED - isQueryOnly=true, connectionStr=iosILUIWU, closeCode=1001
[20:51:41] [WS] Query connection to iosILUIWU closed - cleaning up all agent connections and views
[20:51:41] [CLIENT_SIG] Receive error: Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo={NSErrorFailingURLStringKey=http://crivello.dyndns.org:8081/, NSErrorFailingURLKey=http://crivello.dyndns.org:8081/}
[20:51:41] [CLIENT_SIG] Reconnecting in 4.0s (attempt 2)
[20:51:41] [WS] Connection failed: The operation couldn’t be completed. Socket is not connected
[20:51:41] [WS] Query connection failed - cleaning up all agent connections and views
[20:51:41] [APP_DISCONNECT] Scene disconnecting - logging pending uploads...
[20:51:41] [APP_TERMINATE] ⚠️ 2 pending uploads in DB queue:
[20:51:41] [APP_TERMINATE] - id=335, file=t_21b86ebc5e802df4.jpg, status=uploading, retries=0, size=0.0MB
[20:51:41] [APP_TERMINATE] - id=474, file=1f0e8529cd56643f.mov, status=uploading, retries=0, size=0.0MB
[20:51:41] [LIFECYCLE] ViewController deallocated
[20:57:13] [CRASH] No crash detected
[20:57:13] [FONT] Roboto fonts loaded successfully: Roboto-Regular
[20:57:13] [FONT] ChatFont.regular(18) returns: Roboto-Regular, family: Roboto
[20:57:13] [GIPHY] SDK not available - using REST API fallback
[20:57:13] [BACKGROUND] Background fetch enabled
[20:57:13] [AUTH] Starting PIN authentication
[20:57:13] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[20:57:13] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:57:13] [CLEANUP] No old timer messages to delete
[20:57:13] [PUSH] APNs token: 6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c
[20:57:14] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[20:57:14] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:57:14] [USER] ✅ User registered successfully
[20:57:14] [PUSH] User registration after token update: success
[20:57:14] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[20:57:14] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[20:57:14] [CLIENT_SIG] WebSocket opened
[20:57:14] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[20:57:14] [CLIENT_SIG] Connected! clientId=OOsi36V0tqlFE-Kh
[20:57:14] [CLIENT_SIG] Received 1 clients for session 'ILUIWU' (my session: 'ILUIWU')
[20:57:14] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[20:57:14] [PRELOAD] ⚡ Starting message pre-load during authentication (since_id=18184)...
[20:57:14] [PRELOAD] No messages or parse error
[20:57:15] [PIN_AUTH] Correct PIN
[20:57:15] [SECURITY] Restored real session: ILUIWU
[20:57:15] [SECURITY] Restored real session: ILUIWU
[20:57:15] [SECURITY] Saved real session: ILUIWU
[20:57:15] [SCENE] Launched directly to chat view with sessionId: ILUIWU
[20:57:15] [AUDIO] ✅ Chat mode - audio will be managed by WebRTCViewer (no microphone)
[20:57:15] Documents Directory: /var/mobile/Containers/Data/Application/ACF1B6EF-8F63-4821-A2F3-E2037EA4C87B/Documents
[20:57:16] [UPLOAD_QUEUE] Found 0 pending uploads to resume
[20:57:16] [THEME] Applying current theme
[20:57:16] [CHAT] Applied day theme (mode: day)
[20:57:16] [SECURITY] Saved real session: ILUIWU
[20:57:16] [CLIENT_SIG] Setting up client signaling for session: ILUIWU
[20:57:16] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[20:57:16] [NETWORK] Network monitor started
[20:57:16] [NETWORK] Status changed: connected
[20:57:16] Did transition
[20:57:16] [MODE] 🔍 updateModeUI called - currentTabIndex=0, sessionId=ILUIWU
[20:57:16] [VIEWER] Screen lock enabled - normal idle behavior
[20:57:16] [QUERY] 🔍 Creating query connection for iOS slave: iosILUIWU
[20:57:16] [VCC] ========== VideoConnectionClass INIT ==========
[20:57:16] [VCC] Session: iosILUIWU, ViewIdx: 0, AgentId: nil
[20:57:16] [DATA AUDIO] ========== setupWebRTC() START ==========
[20:57:16] [DATA AUDIO] Using data channel for audio - bypassing WebRTC audio device
[20:57:16] [DATA AUDIO] Creating encoder/decoder factories...
[20:57:16] [CODEC] Viewer - Available video codecs: H264, H264, VP8, VP9, AV1
[20:57:16] [CODEC] Viewer selected encoder: AV1 (best quality)
[20:57:16] [DATA AUDIO] Creating RTCPeerConnectionFactory...
[20:57:16] [DATA AUDIO] ✅ Factory created
[20:57:16] [DATA AUDIO] RTCAudioSession locked
[20:57:16] [DATA AUDIO] Set useManualAudio=true, isAudioEnabled=false
[20:57:16] [DATA AUDIO] RTCAudioSession unlocked
[20:57:16] [DATA AUDIO] Skipping AVAudioSession config - handled by DataChannelAudioPlayer
[20:57:16] [VCC] Initial ICE servers: ["stun:stun.l.google.com:19302", "turn:crivello.dyndns.org:3478?transport=udp", "turn:crivello.dyndns.org:3478?transport=tcp", "turns:crivello.dyndns.org:5349?transport=tcp"]
[20:57:16] [WS] Creating new WebSocket - isQueryOnly=false, connectionStr=iosILUIWU
[20:57:16] [WS] Opening session at ws://crivello.dyndns.org:8081/
[20:57:16] [QUERY] ✅ tempQueryConnection created for iosILUIWU
[20:57:16] [VIEWER_INIT] Already have 50 messages - just filtering for tab
[20:57:16] [EVENT_POLL] Event polling disabled - using WebSocket events instead
[20:57:16] [ORIENTATION] Updated pagingScrollView height to 247.5 for width 440.0
[20:57:16] Did transition
[20:57:16] [TABLEVIEW] cellForRowAt index 0 out of bounds (count=0)
[20:57:16] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[20:57:16] [CHUNK] Merged 841 reactions synchronously
[20:57:16] [RELOAD_TAB] ⏳ Already pending, waiting for debounce
[20:57:16] [GALLERY_DB] Loading ALL media messages for session: ILUIWU
[20:57:16] [MIGRATION] No messages need sender_name backfill
[20:57:16] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[20:57:16] [GALLERY_DB] Raw datesent for msg 18173: '2026-01-18 18:37:42'
[20:57:16] [GALLERY_DB] Raw datesent for msg 18171: '2026-01-18 18:36:13'
[20:57:16] [GALLERY_DB] Raw datesent for msg 18162: '2026-01-18 10:37:29'
[20:57:16] [USER] ✅ User registered successfully
[20:57:16] [USER] User registration successful
[20:57:16] [GALLERY_DB] ✅ Loaded 452 media messages
[20:57:16] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18184
[20:57:16] [INCREMENTAL_SYNC] ✅ No new messages
[20:57:16] [GALLERY] Filtered 452 -> 413 (only with local thumbnails)
[20:57:16] [GALLERY] First 5 after sort (newest first):
[20:57:16] [GALLERY] 0: id=18173, date=2026-01-18 18:37:42, file=c8e574003511e75a.jpg
[20:57:16] [GALLERY] 1: id=18171, date=2026-01-18 18:36:13, file=6881a683a964b6bf.heic
[20:57:16] [GALLERY] 2: id=18162, date=2026-01-18 10:37:29, file=2360d0215b6a2ab2.mov
[20:57:16] [GALLERY] 3: id=18161, date=2026-01-18 10:36:56, file=399b07f80d99b3ff.heic
[20:57:16] [GALLERY] 4: id=18159, date=2026-01-18 10:17:19, file=d709f7e2335b9796.jpeg
[20:57:16] [SCROLL_BTN] Showing button - 32pt from bottom > half 22pt
[20:57:16] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:57:16] [EMOJI] ✅ Loaded 451 emoji-to-GIF mappings
[20:57:16] [SERVER] Starting reconnect polling (5s interval)
[20:57:16] [ICONS] Screen width: 440.0, Tab spacing: 75.5
[20:57:16] [ICONS] Offset applied: -14.6
[20:57:16] [ICONS] New left margin: 11.2, New right margin: 11.3
[20:57:16] [ICONS] Chat center: (31.2, 87.0)
[20:57:16] [ICONS] Gallery center: (106.7, 87.0), deltaX: 75.5
[20:57:16] [ICONS] Camera center: (182.2, 87.0), deltaX: 75.5
[20:57:16] [ICONS] Settings center: (257.7, 87.0), deltaX: 75.5
[20:57:16] [ICONS] Lock centerX: 333.2, deltaX from Settings: 75.5
[20:57:16] [ICONS] Bell centerX: 408.7, deltaX from Lock: 75.5
[20:57:16] [ICONS] LEFT MARGIN (screen left to Chat left): 11.2
[20:57:16] [ICONS] RIGHT MARGIN (Bell right to screen right): 11.3
[20:57:16] [ICONS] Screen width: 440.0
[20:57:16] [WS] WebSocket ACTUALLY OPENED - isQueryOnly=true, connectionStr=iosILUIWU
[20:57:16] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[20:57:16] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[20:57:16] Token POST → https://crivello.dyndns.org:443/WebRTC/public/new_session.php?sid=iosILUIWU
[20:57:16] DOWNLOADIIING 2360d0215b6a2ab2.mov
[20:57:16] [PURGE] ⚠️ Media cache purge DISABLED for debugging
[20:57:16] [UNSENT_RETRY] Checking for unsent messages...
[20:57:16] [UPLOAD_RECOVERY] ========== CHECKING FOR MISSING UPLOADS ==========
[20:57:16] [UPLOAD_RECOVERY] User ID: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF
[20:57:16] [UPLOAD_RECOVERY] Session: ILUIWU
[20:57:16] [UPLOAD_RECOVERY] ✅ No stuck uploads found
[20:57:16] [UPLOAD_RECOVERY] Checking recent media messages on server...
[20:57:16] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18173, file=c8e574003511e75a.jpg, upload_status=complete
[20:57:16] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18171, file=6881a683a964b6bf.heic, upload_status=complete
[20:57:16] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18159, file=d709f7e2335b9796.jpeg, upload_status=complete
[20:57:16] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18127, file=62b393a353b38c70.jpg, upload_status=complete
[20:57:16] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18117, file=ca2813d190665dd2.jpg, upload_status=complete
[20:57:16] [UPLOAD_RECOVERY] Verifying 5 media files exist on server...
[20:57:16] [PENDING_UPLOAD] Total pending upload messages: 0
[20:57:16] [UNSENT_RETRY] No unsent messages found
[20:57:16] new_session POST ok: token len=157
[20:57:16] HELLO → sent (fetched token, role=query)
[20:57:16] [SIG] hello_ok received for query connection - ready to query agents
[20:57:16] [SIG] get_agents request sent for sessionId=ILUIWU
[20:57:16] [SIG] get_agents request sent for sessionId=iosILUIWU
[20:57:16] [SERVER] Stopped reconnect polling
[20:57:16] [SIG] agents_list received: []
[20:57:16] [SIG] agents_list received: []
[20:57:16] [UPLOAD_RECOVERY] ✅ All media files verified on server
[20:57:16] [COMBINED_FETCH] Loaded 6951 read receipts, 840 messages with reactions
[20:57:16] [READBY_ENRICH] Enriched 50 messages with readBy data
[20:57:16] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[20:57:17] [MENU] dismissAnyExistingMenu called
[20:57:17] [MENU] dismissAnyExistingMenu completed
[20:57:17] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:17] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:17] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:57:17] [SCROLL_BTN] Showing button - 387pt from bottom > half 379pt
[20:57:17] [MENU] dismissAnyExistingMenu called
[20:57:17] [MENU] dismissAnyExistingMenu completed
[20:57:17] [MENU] dismissAnyExistingMenu called
[20:57:17] [MENU] dismissAnyExistingMenu completed
[20:57:17] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:17] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:17] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[20:57:18] [SCROLL_BTN] Showing button - 787pt from bottom > half 379pt
[20:57:18] [CELL_UPLOAD] configure: msgId=18162, file=2360d0215b6a2ab2.mov, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:18] [CELL_UPLOAD] → not my message, setting complete
[20:57:18] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=2360d0215b6a2ab2.mov, overlayExists=true
[20:57:18] [MENU] dismissAnyExistingMenu called
[20:57:18] [MENU] dismissAnyExistingMenu completed
[20:57:18] [CELL_UPLOAD] configure: msgId=18161, file=399b07f80d99b3ff.heic, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:18] [CELL_UPLOAD] → not my message, setting complete
[20:57:18] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=399b07f80d99b3ff.heic, overlayExists=true
[20:57:19] [MENU] dismissAnyExistingMenu called
[20:57:19] [MENU] dismissAnyExistingMenu completed
[20:57:27] [MENU] dismissAnyExistingMenu called
[20:57:27] [MENU] dismissAnyExistingMenu completed
[20:57:27] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:27] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:27] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[20:57:28] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:28] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:28] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:57:29] [MENU] dismissAnyExistingMenu called
[20:57:29] [MENU] dismissAnyExistingMenu completed
[20:57:30] [MENU] dismissAnyExistingMenu called
[20:57:30] [MENU] dismissAnyExistingMenu completed
[20:57:32] [MENU] dismissAnyExistingMenu called
[20:57:32] [MENU] dismissAnyExistingMenu completed
[20:57:32] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:32] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:32] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:57:32] [SCROLL_BTN] Showing button - 403pt from bottom > half 379pt
[20:57:32] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:32] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:32] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[20:57:32] [CELL_UPLOAD] configure: msgId=18162, file=2360d0215b6a2ab2.mov, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:32] [CELL_UPLOAD] → not my message, setting complete
[20:57:32] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=2360d0215b6a2ab2.mov, overlayExists=true
[20:57:32] [CELL_UPLOAD] configure: msgId=18161, file=399b07f80d99b3ff.heic, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:32] [CELL_UPLOAD] → not my message, setting complete
[20:57:32] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=399b07f80d99b3ff.heic, overlayExists=true
[20:57:33] [MENU] dismissAnyExistingMenu called
[20:57:33] [MENU] dismissAnyExistingMenu completed
[20:57:33] [MENU] dismissAnyExistingMenu called
[20:57:33] [MENU] dismissAnyExistingMenu completed
[20:57:38] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:38] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:38] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[20:57:38] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[20:57:38] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[20:57:38] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[20:57:40] [LOCK] Lock button tapped - locking app immediately
[20:57:40] [LOCK] Received lock app notification
[20:57:40] [LIFECYCLE] App resigning active - cleared crash flag
[20:57:41] [SECURITY] sceneDidEnterBackground - isAuthenticated=false
[20:57:41] [SECURITY] ⚠️ NOT saving timestamp - isAuthenticated is false
[20:57:41] [LIFECYCLE] App entering background - cleared crash flag
[20:57:41] [CLIENT_SIG] Disconnecting
[20:57:41] [LIFECYCLE] App entering background - disconnecting connections and stopping audio
[20:57:41] [WS] stopSignalingAndPeer called - isQueryOnly=true, connectionStr=iosILUIWU, wsState=0
[20:57:41] [WS] Canceling WebSocket for query connection to iosILUIWU
[20:57:41] In cleanupPeer
[20:57:41] In cleanupPeer
[20:57:41] [LIFECYCLE] WebRTC audio disabled
[20:57:41] [LIFECYCLE] AVAudioSession deactivated
[20:57:41] [LIFECYCLE] All connections stopped
[20:57:41] [SERVER] Stopped reconnect polling
[20:57:41] Will request stop of video 0
[20:57:41] Will request stop of video 0
[20:57:41] [CLIENT_SIG] WebSocket closed with code 1001
[20:57:41] [CLIENT_SIG] Reconnecting in 2.0s (attempt 1)
[20:57:41] [WS] WebSocket ACTUALLY CLOSED - isQueryOnly=true, connectionStr=iosILUIWU, closeCode=1001
[20:57:41] [WS] Query connection to iosILUIWU closed - cleaning up all agent connections and views
[20:57:41] [CLIENT_SIG] Receive error: Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo={NSErrorFailingURLStringKey=http://crivello.dyndns.org:8081/, NSErrorFailingURLKey=http://crivello.dyndns.org:8081/}
[20:57:41] [CLIENT_SIG] Reconnecting in 4.0s (attempt 2)
[20:57:41] [WS] Connection failed: The operation couldn’t be completed. Socket is not connected
[20:57:41] [WS] Query connection failed - cleaning up all agent connections and views
[21:01:02] [CRASH] No crash detected
[21:01:02] [FONT] Roboto fonts loaded successfully: Roboto-Regular
[21:01:02] [FONT] ChatFont.regular(18) returns: Roboto-Regular, family: Roboto
[21:01:02] [GIPHY] SDK not available - using REST API fallback
[21:01:02] [BACKGROUND] Background fetch enabled
[21:01:02] [AUTH] Starting PIN authentication
[21:01:02] [CLIENT_SIG] Reconnecting on foreground for session: ILUIWU
[21:01:02] [CLIENT_SIG] Connecting to session ILUIWU as Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[21:01:02] [CLEANUP] No old timer messages to delete
[21:01:02] [PUSH] APNs token: 6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c
[21:01:02] [PUSH] register_device.php HTTP 200: {"status":"ok","session_id":"ILUIWU","token":"6c0571d5e4b29f63eac8424c26f3737968330e20febf8cd9a320b0952fc80c1c","role":"viewer","muted":1,"removed_from_other_channels":0}
[21:01:02] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[21:01:02] [USER] ✅ User registered successfully
[21:01:02] [PUSH] User registration after token update: success
[21:01:02] [SECURITY] sceneDidBecomeActive - isAuthenticated=false, didEnterBackground=false
[21:01:02] [PUSH_DEBUG] 🟢 App became ACTIVE - resetting badges and triggering pollEventsNow
[21:01:02] [PRELOAD] ⚡ Starting message pre-load during authentication (since_id=18184)...
[21:01:02] [PRELOAD] No messages or parse error
[21:01:02] [CLIENT_SIG] WebSocket opened
[21:01:02] [CLIENT_SIG] HELLO sent as client for session ILUIWU
[21:01:02] [CLIENT_SIG] Connected! clientId=TbOyVAUWoUDn0Ddb
[21:01:02] [CLIENT_SIG] Received 1 clients for session 'ILUIWU' (my session: 'ILUIWU')
[21:01:02] [CLIENT_SIG] - Laurent (3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF)
[21:01:03] [PIN_AUTH] Correct PIN
[21:01:03] [SECURITY] Restored real session: ILUIWU
[21:01:03] [SECURITY] Restored real session: ILUIWU
[21:01:03] [SECURITY] Saved real session: ILUIWU
[21:01:03] [SCENE] Launched directly to chat view with sessionId: ILUIWU
[21:01:03] [AUDIO] ✅ Chat mode - audio will be managed by WebRTCViewer (no microphone)
[21:01:03] Documents Directory: /var/mobile/Containers/Data/Application/ACF1B6EF-8F63-4821-A2F3-E2037EA4C87B/Documents
[21:01:03] [UPLOAD_QUEUE] Found 0 pending uploads to resume
[21:01:03] [THEME] Applying current theme
[21:01:03] [CHAT] Applied day theme (mode: day)
[21:01:03] [SECURITY] Saved real session: ILUIWU
[21:01:03] [CLIENT_SIG] Setting up client signaling for session: ILUIWU
[21:01:03] [CLIENT_SIG] Already connected/connecting to session ILUIWU
[21:01:03] [NETWORK] Network monitor started
[21:01:03] [NETWORK] Status changed: connected
[21:01:03] Did transition
[21:01:03] [MODE] 🔍 updateModeUI called - currentTabIndex=0, sessionId=ILUIWU
[21:01:03] [VIEWER] Screen lock enabled - normal idle behavior
[21:01:03] [QUERY] 🔍 Creating query connection for iOS slave: iosILUIWU
[21:01:03] [VCC] ========== VideoConnectionClass INIT ==========
[21:01:03] [VCC] Session: iosILUIWU, ViewIdx: 0, AgentId: nil
[21:01:03] [DATA AUDIO] ========== setupWebRTC() START ==========
[21:01:03] [DATA AUDIO] Using data channel for audio - bypassing WebRTC audio device
[21:01:03] [DATA AUDIO] Creating encoder/decoder factories...
[21:01:03] [CODEC] Viewer - Available video codecs: H264, H264, VP8, VP9, AV1
[21:01:03] [CODEC] Viewer selected encoder: AV1 (best quality)
[21:01:03] [DATA AUDIO] Creating RTCPeerConnectionFactory...
[21:01:03] [DATA AUDIO] ✅ Factory created
[21:01:03] [DATA AUDIO] RTCAudioSession locked
[21:01:03] [DATA AUDIO] Set useManualAudio=true, isAudioEnabled=false
[21:01:03] [DATA AUDIO] RTCAudioSession unlocked
[21:01:03] [DATA AUDIO] Skipping AVAudioSession config - handled by DataChannelAudioPlayer
[21:01:03] [VCC] Initial ICE servers: ["stun:stun.l.google.com:19302", "turn:crivello.dyndns.org:3478?transport=udp", "turn:crivello.dyndns.org:3478?transport=tcp", "turns:crivello.dyndns.org:5349?transport=tcp"]
[21:01:03] [WS] Creating new WebSocket - isQueryOnly=false, connectionStr=iosILUIWU
[21:01:03] [WS] Opening session at ws://crivello.dyndns.org:8081/
[21:01:03] [QUERY] ✅ tempQueryConnection created for iosILUIWU
[21:01:03] [VIEWER_INIT] Already have 50 messages - just filtering for tab
[21:01:03] [EVENT_POLL] Event polling disabled - using WebSocket events instead
[21:01:03] [ORIENTATION] Updated pagingScrollView height to 247.5 for width 440.0
[21:01:03] Did transition
[21:01:03] [TABLEVIEW] cellForRowAt index 0 out of bounds (count=0)
[21:01:03] [USER] Registering user: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, name: Laurent
[21:01:03] [CHUNK] Merged 841 reactions synchronously
[21:01:03] [RELOAD_TAB] ⏳ Already pending, waiting for debounce
[21:01:03] [GALLERY_DB] Loading ALL media messages for session: ILUIWU
[21:01:03] [MIGRATION] No messages need sender_name backfill
[21:01:03] [INCREMENTAL_SYNC] 🔄 Starting incremental refresh, currentMsgCount=50
[21:01:03] [GALLERY_DB] Raw datesent for msg 18173: '2026-01-18 18:37:42'
[21:01:03] [GALLERY_DB] Raw datesent for msg 18171: '2026-01-18 18:36:13'
[21:01:03] [GALLERY_DB] Raw datesent for msg 18162: '2026-01-18 10:37:29'
[21:01:04] [USER] ✅ User registered successfully
[21:01:04] [USER] User registration successful
[21:01:04] [GALLERY_DB] ✅ Loaded 452 media messages
[21:01:04] [INCREMENTAL_SYNC] 📡 Fetching messages since ID 18184
[21:01:04] [INCREMENTAL_SYNC] ✅ No new messages
[21:01:04] [GALLERY] Filtered 452 -> 413 (only with local thumbnails)
[21:01:04] [GALLERY] First 5 after sort (newest first):
[21:01:04] [GALLERY] 0: id=18173, date=2026-01-18 18:37:42, file=c8e574003511e75a.jpg
[21:01:04] [GALLERY] 1: id=18171, date=2026-01-18 18:36:13, file=6881a683a964b6bf.heic
[21:01:04] [GALLERY] 2: id=18162, date=2026-01-18 10:37:29, file=2360d0215b6a2ab2.mov
[21:01:04] [GALLERY] 3: id=18161, date=2026-01-18 10:36:56, file=399b07f80d99b3ff.heic
[21:01:04] [GALLERY] 4: id=18159, date=2026-01-18 10:17:19, file=d709f7e2335b9796.jpeg
[21:01:04] [SCROLL_BTN] Showing button - 32pt from bottom > half 22pt
[21:01:04] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[21:01:04] [EMOJI] ✅ Loaded 451 emoji-to-GIF mappings
[21:01:04] [SERVER] Starting reconnect polling (5s interval)
[21:01:04] [ICONS] Screen width: 440.0, Tab spacing: 75.5
[21:01:04] [ICONS] Offset applied: -14.6
[21:01:04] [ICONS] New left margin: 11.2, New right margin: 11.3
[21:01:04] [ICONS] Chat center: (31.2, 87.0)
[21:01:04] [ICONS] Gallery center: (106.7, 87.0), deltaX: 75.5
[21:01:04] [ICONS] Camera center: (182.2, 87.0), deltaX: 75.5
[21:01:04] [ICONS] Settings center: (257.7, 87.0), deltaX: 75.5
[21:01:04] [ICONS] Lock centerX: 333.2, deltaX from Settings: 75.5
[21:01:04] [ICONS] Bell centerX: 408.7, deltaX from Lock: 75.5
[21:01:04] [ICONS] LEFT MARGIN (screen left to Chat left): 11.2
[21:01:04] [ICONS] RIGHT MARGIN (Bell right to screen right): 11.3
[21:01:04] [ICONS] Screen width: 440.0
[21:01:04] [WS] WebSocket ACTUALLY OPENED - isQueryOnly=true, connectionStr=iosILUIWU
[21:01:04] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[21:01:04] Trying API base: https://crivello.dyndns.org:443/WebRTC/public/
[21:01:04] Token POST → https://crivello.dyndns.org:443/WebRTC/public/new_session.php?sid=iosILUIWU
[21:01:04] DOWNLOADIIING 2360d0215b6a2ab2.mov
[21:01:04] [PURGE] ⚠️ Media cache purge DISABLED for debugging
[21:01:04] [UNSENT_RETRY] Checking for unsent messages...
[21:01:04] [UPLOAD_RECOVERY] ========== CHECKING FOR MISSING UPLOADS ==========
[21:01:04] [UPLOAD_RECOVERY] User ID: 3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF
[21:01:04] [UPLOAD_RECOVERY] Session: ILUIWU
[21:01:04] [UPLOAD_RECOVERY] ✅ No stuck uploads found
[21:01:04] [UPLOAD_RECOVERY] Checking recent media messages on server...
[21:01:04] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18173, file=c8e574003511e75a.jpg, upload_status=complete
[21:01:04] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18171, file=6881a683a964b6bf.heic, upload_status=complete
[21:01:04] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18159, file=d709f7e2335b9796.jpeg, upload_status=complete
[21:01:04] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18127, file=62b393a353b38c70.jpg, upload_status=complete
[21:01:04] [UPLOAD_RECOVERY] 📋 Recent media: msgId=18117, file=ca2813d190665dd2.jpg, upload_status=complete
[21:01:04] [UPLOAD_RECOVERY] Verifying 5 media files exist on server...
[21:01:04] [PENDING_UPLOAD] Total pending upload messages: 0
[21:01:04] [UNSENT_RETRY] No unsent messages found
[21:01:04] new_session POST ok: token len=157
[21:01:04] HELLO → sent (fetched token, role=query)
[21:01:04] [SIG] hello_ok received for query connection - ready to query agents
[21:01:04] [SIG] get_agents request sent for sessionId=ILUIWU
[21:01:04] [SIG] get_agents request sent for sessionId=iosILUIWU
[21:01:04] [SERVER] Stopped reconnect polling
[21:01:04] [SIG] agents_list received: []
[21:01:04] [SIG] agents_list received: []
[21:01:04] [UPLOAD_RECOVERY] ✅ All media files verified on server
[21:01:04] [COMBINED_FETCH] Loaded 6951 read receipts, 840 messages with reactions
[21:01:04] [READBY_ENRICH] Enriched 50 messages with readBy data
[21:01:04] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=50, first5Ids=[18135, 18136, 18137, 18138, 18139]
[21:01:05] [MENU] dismissAnyExistingMenu called
[21:01:05] [MENU] dismissAnyExistingMenu completed
[21:01:05] [CELL_UPLOAD] configure: msgId=18173, file=c8e574003511e75a.jpg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:05] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[21:01:05] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=c8e574003511e75a.jpg, overlayExists=true
[21:01:05] [SCROLL_BTN] Showing button - 405pt from bottom > half 379pt
[21:01:05] [CELL_UPLOAD] configure: msgId=18171, file=6881a683a964b6bf.heic, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:05] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[21:01:05] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=6881a683a964b6bf.heic, overlayExists=true
[21:01:05] [MENU] dismissAnyExistingMenu called
[21:01:05] [MENU] dismissAnyExistingMenu completed
[21:01:06] [CELL_UPLOAD] configure: msgId=18162, file=2360d0215b6a2ab2.mov, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:06] [CELL_UPLOAD] → not my message, setting complete
[21:01:06] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=2360d0215b6a2ab2.mov, overlayExists=true
[21:01:06] [CELL_UPLOAD] configure: msgId=18161, file=399b07f80d99b3ff.heic, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:06] [CELL_UPLOAD] → not my message, setting complete
[21:01:06] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=399b07f80d99b3ff.heic, overlayExists=true
[21:01:06] [MENU] dismissAnyExistingMenu called
[21:01:06] [MENU] dismissAnyExistingMenu completed
[21:01:09] [MENU] dismissAnyExistingMenu called
[21:01:09] [MENU] dismissAnyExistingMenu completed
[21:01:09] [CELL_UPLOAD] configure: msgId=18159, file=d709f7e2335b9796.jpeg, senderId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=true, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:09] [CELL_UPLOAD] → no active progress, using msg.uploadStatus=0 → complete
[21:01:09] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=d709f7e2335b9796.jpeg, overlayExists=true
[21:01:10] [MENU] dismissAnyExistingMenu called
[21:01:10] [MENU] dismissAnyExistingMenu completed
[21:01:10] [CELL_UPLOAD] configure: msgId=18154, file=80de02d18174956b.jpeg, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:10] [CELL_UPLOAD] → not my message, setting complete
[21:01:10] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=80de02d18174956b.jpeg, overlayExists=true
[21:01:10] [MENU] dismissAnyExistingMenu called
[21:01:10] [MENU] dismissAnyExistingMenu completed
[21:01:11] [CELL_UPLOAD] configure: msgId=18150, file=044523ae024c2e36.mov, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:11] [CELL_UPLOAD] → not my message, setting complete
[21:01:11] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=044523ae024c2e36.mov, overlayExists=true
[21:01:11] [CELL_UPLOAD] configure: msgId=18149, file=bdecbcd267d10e9d.heic, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:11] [CELL_UPLOAD] → not my message, setting complete
[21:01:11] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=bdecbcd267d10e9d.heic, overlayExists=true
[21:01:11] [MENU] dismissAnyExistingMenu called
[21:01:11] [MENU] dismissAnyExistingMenu completed
[21:01:11] [CELL_UPLOAD] configure: msgId=18147, file=22d80b8c4c39c5aa.png, senderId=EYE-SYSTEM-00000000-0000-0000-0000-000000000000, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:11] [CELL_UPLOAD] → not my message, setting complete
[21:01:11] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=22d80b8c4c39c5aa.png, overlayExists=true
[21:01:12] [MENU] dismissAnyExistingMenu called
[21:01:12] [MENU] dismissAnyExistingMenu completed
[21:01:12] [MENU] dismissAnyExistingMenu called
[21:01:12] [MENU] dismissAnyExistingMenu completed
[21:01:13] [COMBINED_FETCH] Loaded 6951 read receipts, 840 messages with reactions
[21:01:13] [PAGINATION] 📜 Loading 50 older messages, firstVisibleRow=8, oldOffset=452.6666666666667
[21:01:13] [PAGINATION] 📜 Total now: 100
[21:01:13] [RELOAD_TAB] 🔄 reloadMessagesForCurrentTab called, allMsgsCount=100, first5Ids=[18085, 18086, 18087, 18088, 18089]
[21:01:13] [PAGINATION] 📜 newHeight=11494.0, heightDiff=5381.0, newOffset=5833.666666666667
[21:01:13] [PAGINATION] 📜 After setContentOffset, actual offset=5833.666666666667
[21:01:13] [CELL_UPLOAD] configure: msgId=18147, file=22d80b8c4c39c5aa.png, senderId=EYE-SYSTEM-00000000-0000-0000-0000-000000000000, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:13] [CELL_UPLOAD] → not my message, setting complete
[21:01:13] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=22d80b8c4c39c5aa.png, overlayExists=true
[21:01:13] [PAGINATION] 📜 After main queue, offset=5837.666666666667
[21:01:13] [CELL_UPLOAD] configure: msgId=18149, file=bdecbcd267d10e9d.heic, senderId=EDAD55A1-003F-415D-AA60-672B34B504FE, myUserId=3B8A4F00-5ABD-47E5-8C88-F15DA9EF83AF, isMyMessage=false, hasFilename=true, isGiphy=false, uploadStatus=0
[21:01:13] [CELL_UPLOAD] → not my message, setting complete
[21:01:13] [CELL_UPLOAD] setUploadStatus(complete, progress=0.0) for file=bdecbcd267d10e9d.heic, overlayExists=true
[21:01:16] [LOG_GESTURE] handleLongPress called, state=1, isToday=true
[21:01:16] [LOG_GESTURE] Long press on Today detected! Triggering log upload...
[21:01:16] [LOG] Long-press on 'Today' detected - prompting for description
[21:01:17] [LOG_GESTURE] handleLongPress called, state=4, isToday=true