mirror of
https://github.com/block/buzz.git
synced 2026-11-06 17:31:19 +00:00
Load displayed identities' profiles for collection labels
A displayed collection such as search results has no member loader, so agents whose profiles were not cached lacked their owner hint and showed as "murderbot (agent)" instead of "baxen's murderbot". Load uncached candidates along with their owners. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
@@ -47,7 +47,14 @@ IdentityNames watchIdentityNames(
|
||||
agentPubkeys: agentPubkeys,
|
||||
fallbackNames: fallbackNames,
|
||||
);
|
||||
final missing = sources.missingOwnerProfiles(names.candidates);
|
||||
// A displayed identity's profile carries its owner hint, so load uncached
|
||||
// candidates as well as their owners; channels load member profiles
|
||||
// elsewhere, but a displayed collection has no other loader.
|
||||
final missing = {
|
||||
for (final key in names.candidates)
|
||||
if (!sources.profiles.containsKey(key)) key,
|
||||
...sources.missingOwnerProfiles(names.candidates),
|
||||
};
|
||||
if (missing.isNotEmpty) {
|
||||
Future.microtask(() {
|
||||
if (ref.context.mounted) {
|
||||
|
||||
@@ -17,6 +17,9 @@ class _FakeUserCacheNotifier extends UserCacheNotifier {
|
||||
|
||||
@override
|
||||
UserProfile? get(String pubkey) => _users[pubkey.toLowerCase()];
|
||||
|
||||
@override
|
||||
Future<bool> preload(List<String> pubkeys) async => true;
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
Reference in New Issue
Block a user