Bug 410532 - draft comments appear with someone else's username
Summary: draft comments appear with someone else's username
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Miles Parker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 410673
Blocks:
  Show dependency tree
 
Reported: 2013-06-11 16:16 EDT by Sam Davis CLA
Modified: 2013-06-20 18:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2013-06-11 16:16:05 EDT
When I add an inline comment, it often shows up with someone else's username until I publish it. I've seen this a lot and still see it on the latest master.
Comment 1 Miles Parker CLA 2013-06-11 16:21:24 EDT
You mean when you look at the web UI? I also sometimes see the comments on the wrong line -- I think that's a long standing issue.
Comment 2 Steffen Pingel CLA 2013-06-11 17:36:59 EDT
The wrong username sounds like a different issue than the rendering in the compare editor. Sam, do you have steps to reproduce?
Comment 3 Sam Davis CLA 2013-06-11 19:59:46 EDT
I am referring to the connector not the web ui. It used to have no username at all for drafts and at some point it started using the name of the previous commenter or something. No steps but it happens so often I'm surprised nobody else has noticed it.
Comment 4 Miles Parker CLA 2013-06-12 14:51:51 EDT
(In reply to comment #3)
> I am referring to the connector not the web ui. It used to have no username at
> all for drafts and at some point it started using the name of the previous
> commenter or something. No steps but it happens so often I'm surprised nobody
> else has noticed it.

Maybe it's just you. ;) How do you even see the author in the Web UI?
Comment 5 Steffen Pingel CLA 2013-06-12 15:18:21 EDT
I have seen this as well. Comments were showing with "null" as the author. It could have been drafts.
Comment 6 Miles Parker CLA 2013-06-12 19:50:15 EDT
So, the only way this could happen if the ReviewItem#getAddedBy was null when we added the comment. That maps to the Gerrit PatchSetDetail author, and I don't know how that could be null. But actually, I just realized..why are we using the patch set author as the commentor?! That should obviously be the user, whoever the original commentor was. And if you were to comment on a patch set that had been rebased by Gerrit, the value would be unspecified, which probably explains some other sporadic issues with comments. (I thought there was a bug on this but I don't see it anymore.)

I probably missed this because all of the test setups have the same user commiting as commenting. We should probably add test coverage for multiple users...
Comment 7 Miles Parker CLA 2013-06-12 19:58:08 EDT
Ha, I just remembered that this one isn't quite so simple as it sounds. That's because, believe it or not, we (meaning the Reviews model) don't actually know who the repository user *is*. We might not even have a user stored in the repository for the IDE user, in the rare instance where that person doesn't have any Reviews that they've contributed to in their queries. So I'll create a new task to accomplish that.
Comment 8 Sam Davis CLA 2013-06-12 20:36:30 EDT
Why can't we use the username from the TaskRepository?
Comment 9 Miles Parker CLA 2013-06-12 20:49:35 EDT
(In reply to comment #8)
> Why can't we use the username from the TaskRepository?

Because we need the Gerrit (or other review host) id. And we need it to be in the model. We could fake it, but it's really better/more consistent to do it this way.
Comment 10 Miles Parker CLA 2013-06-14 18:57:37 EDT
https://git.eclipse.org/r/#/c/13830/
Comment 11 Miles Parker CLA 2013-06-14 19:32:16 EDT
I've gone ahead and combined this one with that for bug 410673; it didn't really make much sense to maintain them separately.

https://git.eclipse.org/r/#/c/13829
Comment 12 Miles Parker CLA 2013-06-20 18:46:22 EDT
Merged: https://git.eclipse.org/r/#/c/13829/