Skip to content

Commit

Permalink
user [nfc]: Document users map, especially its incompleteness
Browse files Browse the repository at this point in the history
  • Loading branch information
gnprice committed Feb 5, 2025
1 parent 6f82fda commit c253f93
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/model/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ import '../api/model/model.dart';

/// The portion of [PerAccountStore] describing the users in the realm.
mixin UserStore {
/// All known users in the realm, by [User.userId].
///
/// There may be other users not found in this map, for multiple reasons:
///
/// * The self-user may not have permission to see all the users in the
/// realm, for example because the self-user is a guest.
///
/// * Because of the fetch/event race, any data that the client fetched
/// outside of the event system may reflect an earlier or later time
/// than this data, which is maintained by the event system.
/// This includes messages fetched for a message list, and notifications.
/// Those may therefore refer to users for which we have yet to see the
/// [RealmUserAddEvent], or have already handled a [RealmUserRemoveEvent].
///
/// Code that looks up a user in this map should therefore always handle
/// the possibility that the user is not found (except
/// where there is a specific reason to know the user should be found).
/// Consider using [ZulipLocalizations.unknownUserName].
Map<int, User> get users;
}

Expand Down

0 comments on commit c253f93

Please sign in to comment.