You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This calls the following swift code https://github.com/xmtp/xmtp-ios/blob/main/Sources/XMTPiOS/Conversations.swift#L165-L182
I have 1744 conversations, but if I log conversationsByTopic length at the end of this method, I see that
it logs a length of 1 many times in the beginning (sometimes ~10 times)
then it increases, so it does not end up at 1744 but sometimes 1735
So it means that conversationsByTopic is “reset” sometimes. And indeed, if I add a log here: https://github.com/xmtp/xmtp-ios/blob/main/Sources/XMTPiOS/Conversations.swift#L60-L62
The init method is called like 10 times. So I think there is a race condition because of my Promise.all, the Conversations class is instantiated many times instead before being reused.
Hope that’s clear enough! Looks like I can fix it manually by calling first await client.conversations.importTopicData(topicsData[0])
to init everything, then call my Promise.all, but that’s not ideal.
The text was updated successfully, but these errors were encountered:
For the convo list not returning the same count, I know what’s happening (and btw I was testing on iOS for that)
My code in RN is the following:
This calls the following swift code
https://github.com/xmtp/xmtp-ios/blob/main/Sources/XMTPiOS/Conversations.swift#L165-L182
I have 1744 conversations, but if I log
conversationsByTopic
length at the end of this method, I see thatit logs a length of 1 many times in the beginning (sometimes ~10 times)
then it increases, so it does not end up at 1744 but sometimes 1735
So it means that conversationsByTopic is “reset” sometimes. And indeed, if I add a log here:
https://github.com/xmtp/xmtp-ios/blob/main/Sources/XMTPiOS/Conversations.swift#L60-L62
The init method is called like 10 times. So I think there is a race condition because of my Promise.all, the Conversations class is instantiated many times instead before being reused.
Hope that’s clear enough! Looks like I can fix it manually by calling first
await client.conversations.importTopicData(topicsData[0])
to init everything, then call my Promise.all, but that’s not ideal.
The text was updated successfully, but these errors were encountered: