Convert BaseResource.save to return a promise.

Review Request #11642 — Created June 2, 2021 and submitted

Information

Review Board
master

Reviewers

This change updates the save machinery for various resources to use
promises and async/await instead of callbacks.

  • Ran js-tests.
  • Manually tested API token creation, comment editing, review request
    field editing, post-commit review request creation, ship-it revocation,
    and file attachment uploading.
Summary ID
Convert BaseResource.save to return a promise.
This change updates the save machinery for various resources to use promises and async/await instead of callbacks. Testing Done: - Ran js-tests. - Manually tested API token creation, comment editing, review request field editing, post-commit review request creation, ship-it revocation, and file attachment uploading.
fe13a59893bbf8cdbb32a68242c9a9926c5d7ec9
Description From Last Updated

Col: 15 'commit' was used before it was defined.

reviewbotreviewbot

Col: 39 Missing semicolon.

reviewbotreviewbot

Does .and.resolveTo() work instead of having to explicitly return Promise.resolve()?

chipx86chipx86

Think this can be .and.rejectWith(new BackboneError(...))

chipx86chipx86

, optional?

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

david
david
david
chipx86
  1. Looks good. There's some Jasmine stuff we can probably use for making spies that resolve/reject. Only highlighted one instance of each.

    Doesn't have to be a blocker for this change.

  2. Show all issues

    Does .and.resolveTo() work instead of having to explicitly return Promise.resolve()?

  3. Show all issues

    Think this can be .and.rejectWith(new BackboneError(...))

  4. Show all issues

    , optional?

  5. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (476e5dc)
Loading...