onboarding: lookup profile after accounts are added

To reduce the side effects of this change, we introduce a new UnknownId
action type:

  - SingleUnkIdAction

This can be returned from functions to signal that we need to do some
work to look for things. We add a `must_use` directive to this type
to ensure callers handle it.

Changelog-Fixed: Fix missing profiles when new accounts are added
Fixes: https://github.com/damus-io/notedeck/issues/356
This commit is contained in:
William Casarin
2024-11-18 17:06:52 -08:00
parent 3b3b8246c8
commit 19933c84f1
6 changed files with 146 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
use std::path::Path;
use enostr::{FullKeypair, Pubkey, RelayPool};
use nostrdb::ProfileRecord;
use nostrdb::{ProfileRecord, Transaction};
use crate::{user_account::UserAccount, Damus};
@@ -100,8 +100,11 @@ pub fn test_app() -> Damus {
let mut app = Damus::mock(path);
let accounts = get_test_accounts();
let txn = Transaction::new(&app.ndb).expect("txn");
for account in accounts {
app.accounts_mut().add_account(account);
app.accounts_mut()
.add_account(account)
.process_action(&mut app.unknown_ids, &app.ndb, &txn)
}
app