Fix a breakage when changing diff revisions while loading diffs.

Review Request #9118 - Created Aug. 3, 2017 and submitted

Christian Hammond
Review Board
release-2.5.x
9aa7f29...
reviewboard

When loading a large diff, users could trigger a page crash by
attempting to change the pagination page or the diff revision. They'd
hit an error in the console and no new diffs would load.

This was caused by an assumption in the load callback handler that the
container for the diff would exist by the time the data was loaded from
the server. If this assumption failed, an invalid attribute would be
accessed, leading to a crash. This would also prevent the next queued
load from occurring, and in turn prevent the queue from ever finishing.
The new page of diffs wouldn't be able to load.

The load handler now checks for the existence of the container, aborting
the load if it no longer exists. Switching pages/diff revisions also now
starts off by clearing the queue to ensure it can start fresh.

Tried switching the set of diffs being shown while diffs were loading.
I no longer experienced the crash, and the new diffs successfully loaded.

David Trowbridge
  1. Ship It!
  2. 
      
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (2c77e60)
Loading...