zulip / zulip-mobile

Zulip mobile apps for Android and iOS.
https://zulip.com/apps/
Apache License 2.0
1.29k stars 650 forks source link

Check mobile compatibility for limited guests #5787

Closed alya closed 10 months ago

alya commented 11 months ago

We should make sure the mobile app is compatible with the changes being made in zulip/zulip#10970.

gnprice commented 11 months ago

I've just taken a look at this, and I've sent #5790 to fix the two issues I found.

I think neither of those is a showstopper. So we should get those fixes out promptly, but not worry about some users still having old clients while encountering the new feature.

I was testing on an approximation of the real feature, though: I tried running https://github.com/zulip/zulip/pull/27544 in my dev server, but AFAICT that PR doesn't yet actually make it possible to enable the feature — it only lays the groundwork. So it'd be good to re-check compatibility when there's something more like a working version of the server feature which can be tried out.


Details on the severity of the two issues

Details on how I approximated the "limited guests" feature

I applied the following ad-hoc diff:

--- a/src/users/usersReducer.js
+++ b/src/users/usersReducer.js
@@ -14,2 +14,4 @@ const initialState: UsersState = NULL_ARRAY;

+const allowedUsers = new Set(["Cordelia, Lear's daughter", 'Polonius']);
+
 export default (
@@ -23,3 +25,3 @@ export default (
     case REGISTER_COMPLETE:
-      return action.data.realm_users;
+      return action.data.realm_users.filter(u => allowedUsers.has(u.full_name));

This causes the app, when it's first loading server data, to drop on the floor any users other than the two named. (And other than deactivated users and system bots, which this diff doesn't affect.) Then I logged into my dev server as Polonius, a guest user.

Details on what I tested

I explored various parts of the UI in the presence of unknown users, trying to think of all the various places we show information on a user:

I also looked through the code:

alya commented 11 months ago

Awesome, thank you for the investigation and the detailed notes!

@sahil839 FYI

gnprice commented 10 months ago

OK, with https://github.com/zulip/zulip/pull/27544 and then https://github.com/zulip/zulip/pull/27873, it's now possible to test the actual implementation of this using a dev server. Here's what I found:


In summary:

gnprice commented 10 months ago
  • Several places […] show a blank instead of the intended avatar, while other places successfully show it. This calls for some debugging.

Aha, here's the issue:

The "unknown user" avatar doesn't exist on the server in all the places that a normal avatar image would.

I'll follow up on the #api design thread.

chrisbobbe commented 10 months ago

I tested and confirmed that the avatar issue (zulip/zulip#28071) has been fixed. So from Greg's message above, I think the following is the only remaining item, and fixing it would close this issue?

  • Lists of users (the "user list" component found in several places including "New DM", and the autocomplete for @-mentions) include the unknown users and shouldn't. We can fix that once a planned server feature is added.
sahil839 commented 10 months ago

965869d3f8e added client capability to not receive data for unknown users.

gnprice commented 10 months ago

Thanks @chrisbobbe and @sahil839 for those updates! I've filed #5808 for the followup based on those. The compatibility is now thoroughly checked, so closing this issue.