-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
users reducer: Handle all user updates from realm_user op: update #5386
Commits on May 20, 2022
-
eventToAction [nfc]: Express a conditional differently
This will let us do an `else if`.
Configuration menu - View commit details
-
Copy full SHA for b0bf0a4 - Browse repository at this point
Copy the full SHA b0bf0a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8471961 - Browse repository at this point
Copy the full SHA 8471961View commit details -
users state [nfc]: Pass realm_user update events through more directly
Following the generic "server event" pattern Greg started in 979d283. We still convert avatar_url to our special AvatarURL form at the edge, in eventToAction, for crunchy shell: https://github.com/zulip/zulip-mobile/blob/master/docs/architecture/crunchy-shell.md Also, give a Flow type to the event itself as we receive it from the server: RealmUserUpdateEventRaw. We should keep this up-to-date with the server API documentation. (We also have RealmUserUpdateEvent, for the slightly processed form that has AvatarURL.) We still keep the behavior of only allowing avatar_url and role changes to apply to the state [1]. But now, that code is in usersReducer instead of eventToAction. For the reducer tests that simulate actions changing *other* user data, that means they'd now fail. So, skip them, with a plan to re-enable. [1] Because we've been wary of accepting server data that we haven't vetted; see 7296551. The API doc seems to have been improved since then, and now we've written down a type for it. So now we can proceed more confidently, which is nice!
Configuration menu - View commit details
-
Copy full SHA for 3b3dbfd - Browse repository at this point
Copy the full SHA 3b3dbfdView commit details
Commits on May 21, 2022
-
users reducer tests [nfc]: Fill out user-update tests (still skipped)
The reducer still doesn't handle all these cases, so we can't un-skip them yet. But now at least we're prepared to cover all the cases once the reducer *does* handle them, soon. See the list of cases in the doc: https://zulip.com/api/get-events#realm_user-update The removed comment was wrong to say that we should exclude a test for bot-owner changes. The users state doesn't include cross-realm bots, it's true. But it does include regular bots, and those are the bots that have owners.
Configuration menu - View commit details
-
Copy full SHA for d64b2b2 - Browse repository at this point
Copy the full SHA d64b2b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7c57df - Browse repository at this point
Copy the full SHA d7c57dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 32da02a - Browse repository at this point
Copy the full SHA 32da02aView commit details
Commits on May 23, 2022
-
realm_user event: Fix custom_profile_field.value to be string | null
See zulip/zulip#22103, which I sent after observing that this was sometimes null.
Configuration menu - View commit details
-
Copy full SHA for 5dc4770 - Browse repository at this point
Copy the full SHA 5dc4770View commit details