Skip to content

Commit

Permalink
fix: fetch remote messages on main queue (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 authored Aug 21, 2024
1 parent 6359c01 commit 9fc527b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ class MessageQueueManager {
}

func fetchUserMessagesFromRemoteQueue() {
Logger.instance.debug(message: "Fetching user messages from remote queue")
fetchUserMessages()
// Fetching user messages from remote queue should be done on main thread as it directly interacts with WebViews.
// Not doing so can cause crashes on wrapper frameworks like React Native.
DispatchQueue.main.async {
Logger.instance.debug(message: "Fetching user messages from remote queue")
self.fetchUserMessages()
}
}

@objc
Expand Down

0 comments on commit 9fc527b

Please sign in to comment.