Skip to content

msglist: Don't assume people with the same name are the same. #4304

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

Merged
merged 2 commits into from
Nov 12, 2020

Conversation

gnprice
Copy link
Member

@gnprice gnprice commented Nov 11, 2020

Fixes: #4303

Sadly we can't use the sender's actual, permanent, numeric user ID here, because outbox messages (values of type Outbox) don't have a sender_id. For now, using the email suffices to fix this bug, and leaves this code no worse than a lot of the rest of our code.

We also add a sender_id property to Outbox... but don't yet switch to using it, because existing outbox messages, if there were any just before the user upgrades to a release with this change, won't yet have it. Once such a release has been out for a few weeks, we can make the property required and have a migration just drop any values lacking it. There's a TODO comment marking this as one of the many sites of #3674.

@chrisbobbe
Copy link
Contributor

There's a TODO comment marking this as one of the many sites of #3674.

Do you mean #3764?

@@ -31,11 +31,11 @@ export default (
data: [],
});
}

// TODO(#3674): Use sender_id, not sender_email. Needs adding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean #3764?

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Nov 12, 2020

LGTM except for two tiny comments, above—I think those are just typos in an issue number.

@gnprice
Copy link
Member Author

gnprice commented Nov 12, 2020

Do you mean #3764?

Ha, indeed I do. Thanks for the catch!

I'll edit that and merge.

Discovered this bug by reading the code, while studying this function
to understand zulip#4301 (for 5b52614.)  Kind of hard to see how this
way of writing it could ever have seemed like the right thing to do;
it's been this way essentially forever, since f1b10f4 in 2016.

Sadly we can't use the sender's actual, permanent, numeric user ID
here, because outbox messages (values of type Outbox) don't have a
sender_id.  We'll fix that next.  For now, using the email suffices
to fix this bug, and leaves this code no worse than a lot of the
rest of our code.

Fixes: zulip#4303
This will allow us to stop using sender_email to identify users
in places like renderMessages.
@gnprice gnprice force-pushed the pr-msglist-name-vs-id branch from e4c1326 to a1fad7c Compare November 12, 2020 20:05
@gnprice gnprice merged commit a1fad7c into zulip:master Nov 12, 2020
@gnprice gnprice deleted the pr-msglist-name-vs-id branch November 12, 2020 20:16
gnprice added a commit that referenced this pull request Oct 18, 2021
We started supplying this property in 0c251bf / #5000.  That went
out to users a few weeks ago, in v17.171 which rolled out 2021-09-23,
so by this point the bulk of our users have upgraded to that version.
Now we mark the property as required, and drop any old outbox messages
that lack it in the unlikely case that there are any.

This completes #3998 because we've already done the same thing for
`sender_id`, in a1fad7c / #4304 and then 60847c9 / #4667.

Fixes: #3998
gnprice added a commit to gnprice/zulip-mobile that referenced this pull request Oct 19, 2021
We started supplying this property in 0c251bf / zulip#5000.  That went
out to users a few weeks ago, in v17.171 which rolled out 2021-09-23,
so by this point the bulk of our users have upgraded to that version.
Now we mark the property as required, and drop any old outbox messages
that lack it in the unlikely case that there are any.

This completes zulip#3998 because we've already done the same thing for
`sender_id`, in a1fad7c / zulip#4304 and then 60847c9 / zulip#4667.

Fixes: zulip#3998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consecutive messages from same-named senders shown as if same sender
2 participants