Skip to content
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

api: On reaction events, stop assuming old user object is present #5912

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/api/modelTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,6 @@ export type ReactionType = 'unicode_emoji' | 'realm_emoji' | 'zulip_extra_emoji'

/**
* An emoji reaction to a message.
*
* The raw JSON from the server may have a different structure, but we
* normalize it to this form.
*/
export type Reaction = $ReadOnly<{|
user_id: UserId,
Expand Down
8 changes: 0 additions & 8 deletions src/events/eventToAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,6 @@ export default (state: PerAccountState, event: $FlowFixMe): EventAction | null =
case 'reaction':
return {
...event,

// Raw reaction events from the server have a variation on the
// properties of `Reaction`: instead of `user_id: UserId`, they have
// `user: {| email: string, full_name: string, user_id: UserId |}`.
// NB this is different from the reactions in a `/messages` response;
// see `getMessages` to compare.
user_id: event.user.user_id,

type: opToActionReaction[event.op],
};

Expand Down
Loading