Issue 651: Starring items in the dashboard does not star them in the dependencies
Status:  Released
Owner: ----
Closed:  Mar 2012
Reported by jeffs...@google.com, Aug 2, 2010
Affected Version: 2.1.4-rc2

1. Go to your list of changes (or all open changes, or any other list of changes)
2. Star a change from that list
3. Go to some other change that lists that change as a dependency or as a child, and open the Dependencies tab

The change you starred in step 2 should have a star next to it in the Depends On or Needed By list. It does not. Interestingly, doing the reverse (starring a change in the Depends On or Needed By list, and viewing it on the dashboard) works fine.

Aug 17, 2010
Project Member #1 mf...@codeaurora.org
This description does not quite seem accurate to me.  From my experiences, the dependency list simply does not reflect any starred changes unless they were starred right then and there.  In other words, if you star a dependency, yes you will see the star, but as soon as you leave the screen and come back, it will no longer be displayed.  On loading the dependency screen, none of the dependencies are loaded with their starred values.  

The class doing the loading seems to be ChangeDetailFactory; the loadCurrentPatchSet() method loads the dependencies ChangeInfo, but the ChangeInfo class populates its info from a Change object.  The Change object does not know whether it is starred by the current user or not, so in order for a ChangeInfo object to know, this starring info needs to be set explicitly on it.  This explicit set is done in the ChangeListServiceImpl when loading a list of changes.  I am not sure why this class was not used instead of ChangeDetailFactory to load a change's dependencies, but I suspect that it is because this is more heavyweight (it seems to require querying all of the user's starred changes).  I am not sure how to go about fixing this (perhaps with an individual query on each change in the dependency list?), but hopefully I have analyzed the problem well enough that someone with more authority can suggest the proper fix.

Aug 19, 2010
#2 sop@google.com
This is easy.  We (typically) have the starred changes ready for the user.

We just need to get a CurrentUser via injection and ask it for the
gerStarredChanges().  Then test to see if the Change.Id happens
to be in this set.

Most users have only a few changes starred.  The sets aren't big.

I'll actually fix this tomorrow and slide it into 2.1.5.  Its taking
me longer to write "this is easy" than it is to actually fix it.
Status: Accepted
Labels: Milestone-2.1.5
Aug 20, 2010
#3 sop@google.com
Fixed by Id019323707a6d3fa42d26660a80526c8cae91155
Status: Fixed
Labels: -Milestone-2.1.5 FixedIn-2.1.5
Mar 27, 2012
#4 sop@google.com
(No comment was entered for this change.)
Status: Released