Fix onboarding crash

This commit fixes a crash that occurred when clicking "follow all"
during onboarding.

This fix works by making `Contacts` and `PostBox` isolated into a
specific Swift Actor, and updating direct and indirect usages
accordingly.

Changelog-Fixed: Fixed a crash that occurred when clicking "follow all" during onboarding.
Closes: https://github.com/damus-io/damus/issues/3422
Co-authored-by: alltheseas <64376233+alltheseas@users.noreply.github.com>
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
Daniel D’Aquino
2026-01-05 17:28:06 -08:00
co-authored by alltheseas
parent 368f94a209
commit 71c36052e2
31 changed files with 96 additions and 39 deletions
@@ -206,7 +206,7 @@ struct SearchResultsView_Previews: PreviewProvider {
}
*/
@MainActor
func search_for_string(profiles: Profiles, contacts: Contacts, search new: String) -> Search? {
guard new.count != 0 else {
return nil
@@ -267,6 +267,7 @@ func make_hashtagable(_ str: String) -> String {
return String(new.filter{$0 != " "})
}
@MainActor
func search_profiles(profiles: Profiles, contacts: Contacts, search: String) -> [Pubkey] {
// Search by hex pubkey.
if let pubkey = hex_decode_pubkey(search),