Require REVIEWED option to retrieve reviewed flag from /changes/
Setting the reviewed flag in the ChangeInfo JSON requires loading all ChangeMessage entities for the current patch set, sorting them by the date, and filtering to find an entry by the calling user. This information is only valid for the caller. When viewing another user's dashboard changes are marked bold if the *caller* has not reviewed the change, not if the owner of the displayed dashboard has. This is outright misleading. On dashboards that are not the callers highlighting is now disabled and the reviewed flag is not computed. The reviewed flag and highlighting is not used in search results, such as All > Open. Computing the reviewed flag for the signed in caller is a waste of server CPU resources. As the queries are performed sequentially during JSON result construction, this is also very slow on slower database environments like gerrit-review. Disable the recursive query logic behind an option in the request, significantly cutting costs for common queries. Change-Id: If8acbe430e8803e1d9cfcb747dfe28713c1b6da4
This commit is contained in:
@@ -40,7 +40,10 @@ public enum ListChangesOption {
|
||||
MESSAGES(9),
|
||||
|
||||
/** Include allowed actions client could perform. */
|
||||
CURRENT_ACTIONS(10);
|
||||
CURRENT_ACTIONS(10),
|
||||
|
||||
/** Set the reviewed boolean for the caller. */
|
||||
REVIEWED(11);
|
||||
|
||||
private final int value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user