Skip to content

Commit b30bfa7

Browse files
committed
store [nfc]: Add comment to verify RealmUserUpdateEvent handling is exhaustive
This was prompted by noticing recently that we weren't updating [User.isActive]: zulip#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.
1 parent 241f6d7 commit b30bfa7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/model/store.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
465465
if (user == null) {
466466
return; // TODO log
467467
}
468+
// Fields on [User] not updated here:
469+
// userId, dateJoined, isBot, botType, isSystemBot
470+
// Each of those is immutable on any given user, and there are no
471+
// RealmUserUpdateEvent events that update them.
468472
if (event.fullName != null) user.fullName = event.fullName!;
469473
if (event.avatarUrl != null) user.avatarUrl = event.avatarUrl!;
470474
if (event.avatarVersion != null) user.avatarVersion = event.avatarVersion!;

0 commit comments

Comments
 (0)