Skip to content

Commit

Permalink
log entering/leaving realtime
Browse files Browse the repository at this point in the history
this is useful for debugging.
ftr, using deinit() seems to be file as this is called through
"Automatic Reference Counting", not garbage collection at a later point
(https://docs.swift.org/swift-book/documentation/the-swift-programming-language/deinitialization/ )
  • Loading branch information
r10s committed Nov 21, 2024
1 parent 89466fa commit 1091b37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deltachat-ios/Controller/WebxdcViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ class WebxdcViewController: WebViewViewController {
}

deinit {
logger.info("⬅️ leave realtime by deinit")
dcContext.leaveWebxdcRealtime(messageId: messageId)
}

Expand Down Expand Up @@ -516,6 +517,7 @@ extension WebxdcViewController: WKScriptMessageHandler {
}

case .sendRealtimeAdvertisement:
logger.info("➡️ send realtime advertisement")
dcContext.sendWebxdcRealtimeAdvertisement(messageId: messageId)

case .sendRealtimeData:
Expand All @@ -524,6 +526,7 @@ extension WebxdcViewController: WKScriptMessageHandler {
}

case .leaveRealtime:
logger.info("⬅️ leave realtime by xdc request")
dcContext.leaveWebxdcRealtime(messageId: messageId)
}
}
Expand Down

0 comments on commit 1091b37

Please sign in to comment.