Update canPaginate only on MainActor
We're getting a purple/violet concurrency warning in Xcode whenever we paginate a room.
However it's pretty clear that Xcode is putting the warning on the incorrect line. We only ever update the localEchoMessage
on the main thread, so that can't be the var that's the problem.
I finally had a sec to track this down and yup there is one place where we are failing to update a @Published
var of the Room
on the MainActor
. The var is canPaginate
, updated right here:
All that's left is to wrap that one line in await MainActor.run { }
Edited by Charles Wright