Convert BaseResource.save to return a promise.
Review Request #11642 — Created June 2, 2021 and submitted
Information | |
---|---|
david | |
Review Board | |
master | |
Reviewers | |
reviewboard | |
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 | |
---|---|
Description | From | Last Updated |
---|---|---|
Col: 15 'commit' was used before it was defined. |
![]() |
|
Col: 39 Missing semicolon. |
![]() |
|
Does .and.resolveTo() work instead of having to explicitly return Promise.resolve()? |
|
|
Think this can be .and.rejectWith(new BackboneError(...)) |
|
|
, optional? |
|
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+1978 -2068) |
Checks run (2 succeeded)
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+2418 -2198) |
Checks run (2 succeeded)
Change Summary:
Use
expectAsync
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+2402 -2198) |
Checks run (2 succeeded)
-
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.
-
reviewboard/static/rb/js/models/tests/commentEditorModelTests.es6.js (Diff revision 4) Does
.and.resolveTo()
work instead of having to explicitly returnPromise.resolve()
? -
-
reviewboard/static/rb/js/resources/models/draftReviewRequestModel.es6.js (Diff revision 4) , optional
?
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+2324 -2186) |