Skip to content

Commit

Permalink
store [nfc]: Add comment to verify RealmUserUpdateEvent handling is e…
Browse files Browse the repository at this point in the history
…xhaustive

This was prompted by noticing recently that we weren't updating
[User.isActive]:
  #816 (comment)

After fixing that, I looked and found there were actually three
other fields on User which we weren't updating -- a latent bug,
since we never looked at those fields, but a bug.  Fixed that in
the preceding commit.

Now add a comment showing my work on verifying that that's it,
and giving us a head start on re-verifying that in the future
with whatever's changed in the API between now and then.
  • Loading branch information
gnprice committed Aug 10, 2024
1 parent 241f6d7 commit b30bfa7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/model/store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
if (user == null) {
return; // TODO log
}
// Fields on [User] not updated here:
// userId, dateJoined, isBot, botType, isSystemBot
// Each of those is immutable on any given user, and there are no
// RealmUserUpdateEvent events that update them.
if (event.fullName != null) user.fullName = event.fullName!;
if (event.avatarUrl != null) user.avatarUrl = event.avatarUrl!;
if (event.avatarVersion != null) user.avatarVersion = event.avatarVersion!;
Expand Down

0 comments on commit b30bfa7

Please sign in to comment.