)]}'
{
  "commit": "22f4e92288ac07a679765c62000068d2fa8a7aed",
  "tree": "43a3742ecf2153be8f177f577e7b6e1cd1193b68",
  "parents": [
    "1070800279e56f465ffb6ad0e792092166ec82aa"
  ],
  "author": {
    "name": "Kamil Musin",
    "email": "kamilm@google.com",
    "time": "Wed Mar 27 17:26:16 2024 +0100"
  },
  "committer": {
    "name": "Kamil Musin",
    "email": "kamilm@google.com",
    "time": "Thu Mar 28 12:40:08 2024 +0100"
  },
  "message": "Improve change-model load change consistency\n\n1. Only update the change if change is undefined, or if the change\nnumber is the same:\nThere must be a consistency between ChangeViewModel and\nChangeModel. Only change to a ChangeViewModel is allowed to change the\nchangeNum, while all other calls to updateStateChange can only\nupdate the info of the current change to a more recent one. The update\nthrough rxjs can load a different change since updateLoadingState sets\nthe change to undefined.\n\n2. Simplify LoadingState and remove RELOADING:\nRELOADING state previously could only happen as the result of a\nfollowing race condition ChangeViewModel forceLoad sets changNum to\nundefined and then async schedules setting it back to the original\nstate. The RELOADING is only set if the processing of restApi results\n(no actual calls are performed since changeNum is undefined) is\nscheduled later in the Event Queue than the restoration of the\noriginal state. Moreover the actual difference between LOADING and\nRELOADING never matters in code.\n\nWe simplify the logic by removing RELOADING state. Passing a undefined\nchangeNum, will immediately set the change to undefined and LoadingState\nto NOT_LOADED. Previously it would be \"change is undefined\", loading\nstate \"LOADED\", until it changes to \"NOT_LOADED\" in the next Event Queue\ncycle (or \"RELOADING\" if the race is won by the forceLoad)\n\n3. Move updateRevisionsWithCommitShas into updateStateChange:\nThis makes the state more consistent. Now the change in ChangeModel\nalways has the values set, regardless whether the value came from a\nmanual call or subscription.\n\n4. Add catchError, to reset LoadingState if the RestApi calls throw an\nerror\n\nGoogle-Bug-Id: b/328632912\nRelease-Notes: skip\nChange-Id: I0ed368df7152150ed974c0b337894758ee531344\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1a18e9c6f301eb3179f225ba96c1e660b9ccf60a",
      "old_mode": 33188,
      "old_path": "polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts",
      "new_id": "0bf49db4678274b22beea4e9491e2e85f6192873",
      "new_mode": 33188,
      "new_path": "polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts"
    },
    {
      "type": "modify",
      "old_id": "24141079a194544b8f14fe10a0ba7b5b1106266a",
      "old_mode": 33188,
      "old_path": "polygerrit-ui/app/models/change/change-model.ts",
      "new_id": "bba7e4729ac362f8961613243eb15313a9934b14",
      "new_mode": 33188,
      "new_path": "polygerrit-ui/app/models/change/change-model.ts"
    },
    {
      "type": "modify",
      "old_id": "f074ac34bcbfa31f7406bb5f5605c317c264cc3b",
      "old_mode": 33188,
      "old_path": "polygerrit-ui/app/models/change/change-model_test.ts",
      "new_id": "ebe60664a9dd7d752a4e7f058e3724e4750a3b0a",
      "new_mode": 33188,
      "new_path": "polygerrit-ui/app/models/change/change-model_test.ts"
    },
    {
      "type": "modify",
      "old_id": "767e6047178f61759fc44b5cf6c7545c135717e4",
      "old_mode": 33188,
      "old_path": "polygerrit-ui/app/models/checks/checks-model_test.ts",
      "new_id": "a8eda0ff30291d923fdf9c677ca8ca0aab1fcc3b",
      "new_mode": 33188,
      "new_path": "polygerrit-ui/app/models/checks/checks-model_test.ts"
    },
    {
      "type": "modify",
      "old_id": "43e06a4081e5fc8d8abeea17450d84de3d7dfbe4",
      "old_mode": 33188,
      "old_path": "polygerrit-ui/app/types/types.ts",
      "new_id": "f48588b35c71f2e5715b09cc2f51cbc45d9f7fbd",
      "new_mode": 33188,
      "new_path": "polygerrit-ui/app/types/types.ts"
    }
  ]
}
