From b30bfa7e7083b58b78b10c8d2c9d99c6dbf4eeff Mon Sep 17 00:00:00 2001 From: Greg Price Date: Fri, 9 Aug 2024 20:28:07 -0700 Subject: [PATCH] store [nfc]: Add comment to verify RealmUserUpdateEvent handling is exhaustive This was prompted by noticing recently that we weren't updating [User.isActive]: https://github.com/zulip/zulip-flutter/pull/816#discussion_r1689098946 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. --- lib/model/store.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/model/store.dart b/lib/model/store.dart index 228ff2b37e..56c0eaee6d 100644 --- a/lib/model/store.dart +++ b/lib/model/store.dart @@ -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!;