Fixed RB.apiCall overwriting completed callback function.

Review Request #10745 — Created Oct. 9, 2019 and updated — Latest diff uploaded

Information

Review Board
master

Reviewers

In the RB.apiCall function, there are options that the caller can pass in,
and these options include callback functions that handle a request completing,
failing, or succeeding. However, the error and completed callback options
ended up overwriting the default request handler functions, while they
should have been called from within those default functions instead.

This patch fixes this issue for the completed callback, but it does
not resolve it for the error callback. It seems like certain parts
of the codebase (such as adding comments to reviews) completely broke when
I tried to resolve it for the error callback. Those issues will need to
be fixed before this patch can be applied for the error callback.

  1. I ran the JavaScript unit tests.
  2. I tested AJAX calls manually by creating comments on reviews.

Commits

Files