fix: resolve dropped friends list by properly handling chunked social snapshots
The social snapshot chunking mechanism (introduced in v1.6.2) split the friends list correctly on the BridgeClient, but the BridgeService was discarding subsequent chunks. This updates the Manager to explicitly process and combine all received chunks via the database before updating the AddFriendDialog UI.
This commit is contained in:
@@ -229,7 +229,6 @@ class BridgeService : Service() {
|
||||
pendingSocialSnapshotCallback?.let { callback ->
|
||||
pendingSocialSnapshotCallback = null
|
||||
callback(parsedFriends, parsedGroups)
|
||||
return
|
||||
}
|
||||
remoteSideContext.database.replaceMessagingData(parsedFriends, parsedGroups)
|
||||
remoteSideContext.database.receiveMessagingDataCallback(parsedFriends, parsedGroups)
|
||||
|
||||
@@ -138,6 +138,11 @@ fun AppDatabase.replaceMessagingData(
|
||||
} finally {
|
||||
database.endTransaction()
|
||||
}
|
||||
|
||||
// Notify with the full updated list from the DB
|
||||
val allFriends = getFriends(descOrder = true)
|
||||
val allGroups = getGroups()
|
||||
receiveMessagingDataCallback(allFriends, allGroups)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -256,11 +256,7 @@ class AddFriendDialog(
|
||||
)
|
||||
}
|
||||
|
||||
if (context.bridgeService != null) {
|
||||
context.bridgeService?.requestEphemeralSocialSnapshot(updateSnapshot)
|
||||
} else {
|
||||
context.database.receiveMessagingDataCallback = updateSnapshot
|
||||
}
|
||||
context.database.receiveMessagingDataCallback = updateSnapshot
|
||||
context.requestSocialSnapshotRefresh()
|
||||
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
|
||||
Reference in New Issue
Block a user