Update diff viewer to not use $.funcQueue.

Review Request #14102 — Created Aug. 13, 2024 and updated

Information

Review Board
master

Reviewers

This change introduces a new PromiseQueue, which replaces our old
$.funcQueue system. This works very similarly, where we can add a
bunch of items to the queue and then start it, potentially adding items
even as its running. The big difference is that the individual functions
don't need to care at all that they're running within the queue or ask
the queue to move on to the next item, because they're just promises or
async functions.

This also adds an abort signal, which is both handled internally in the
queue and also passed through to any functions that are included. This
fixes one of our long-standing bugs where rapid switching between
interdiff revisions or commit ranges would cause the displayed diffs to
be incorrect, showing files multiple times or diffs from the wrong
revisions.

  • Ran js-tests.
  • Loaded a ton of different diffs and switched rapidly between revisions
    and commit ranges. Saw that the correct files were always loaded and
    we never got weird duplicates.
Summary ID
Update diff viewer to not use $.funcQueue.
This change introduces a new `PromiseQueue`, which replaces our old `$.funcQueue` system. This works very similarly, where we can add a bunch of items to the queue and then start it, potentially adding items even as its running. The big difference is that the individual functions don't need to care at all that they're running within the queue or ask the queue to move on to the next item, because they're just promises or async functions. This also adds an abort signal, which is both handled internally in the queue and also passed through to any functions that are included. This fixes one of our long-standing bugs where rapid switching between interdiff revisions or commit ranges would cause the displayed diffs to be incorrect, showing files multiple times or diffs from the wrong revisions. Testing Done: - Ran js-tests. - Loaded a ton of different diffs and switched rapidly between revisions and commit ranges. Saw that the correct files were always loaded and we never got weird duplicates. Bugs Fixed: 3938
aa0377d95f091422df73bf0e45301033651a4472
Description From Last Updated

This looks great, but it definitely needs thorough unit testing of the queue itself. (Getting flashbacks to both funcQueue and …

chipx86chipx86

console.error?

chipx86chipx86

Needs to be a single-line summary.

chipx86chipx86
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    This looks great, but it definitely needs thorough unit testing of the queue itself. (Getting flashbacks to both funcQueue and SlotChain debugging nightmares.)

    1. Added testing for all of the different permutations I can think of. The use of promises makes this all a lot simpler than the old funcQueue, which is very nice.

  3. Show all issues

    console.error?

  4. Show all issues

    Needs to be a single-line summary.

  5. 
      
david
Review request changed
Commits:
Summary ID
Update diff viewer to not use $.funcQueue.
This change introduces a new `PromiseQueue`, which replaces our old `$.funcQueue` system. This works very similarly, where we can add a bunch of items to the queue and then start it, potentially adding items even as its running. The big difference is that the individual functions don't need to care at all that they're running within the queue or ask the queue to move on to the next item, because they're just promises or async functions. This also adds an abort signal, which is both handled internally in the queue and also passed through to any functions that are included. This fixes one of our long-standing bugs where rapid switching between interdiff revisions or commit ranges would cause the displayed diffs to be incorrect, showing files multiple times or diffs from the wrong revisions. Testing Done: - Ran js-tests. - Loaded a ton of different diffs and switched rapidly between revisions and commit ranges. Saw that the correct files were always loaded and we never got weird duplicates. Bugs Fixed: 3938
74ef367f5d16ddc136f46474dd89a4de85f8f098
Update diff viewer to not use $.funcQueue.
This change introduces a new `PromiseQueue`, which replaces our old `$.funcQueue` system. This works very similarly, where we can add a bunch of items to the queue and then start it, potentially adding items even as its running. The big difference is that the individual functions don't need to care at all that they're running within the queue or ask the queue to move on to the next item, because they're just promises or async functions. This also adds an abort signal, which is both handled internally in the queue and also passed through to any functions that are included. This fixes one of our long-standing bugs where rapid switching between interdiff revisions or commit ranges would cause the displayed diffs to be incorrect, showing files multiple times or diffs from the wrong revisions. Testing Done: - Ran js-tests. - Loaded a ton of different diffs and switched rapidly between revisions and commit ranges. Saw that the correct files were always loaded and we never got weird duplicates. Bugs Fixed: 3938
aa0377d95f091422df73bf0e45301033651a4472

Checks run (2 succeeded)

flake8 passed.
JSHint passed.