Convert BaseResource.save to return a promise.
Review Request #11642 — Created June 2, 2021 and submitted
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 |
---|---|
fe13a59893bbf8cdbb32a68242c9a9926c5d7ec9 |
Description | From | Last Updated |
---|---|---|
Col: 15 'commit' was used before it was defined. |
reviewbot | |
Col: 39 Missing semicolon. |
reviewbot | |
Does .and.resolveTo() work instead of having to explicitly return Promise.resolve()? |
chipx86 | |
Think this can be .and.rejectWith(new BackboneError(...)) |
chipx86 | |
, optional? |
chipx86 |
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) |