Conversation
src/sentry/static/sentry/app/utils/requestError/requestError.tsx
Outdated
Show resolved
Hide resolved
a6d8429 to
85e12c0
Compare
src/sentry/static/sentry/app/api.tsx
Outdated
There was a problem hiding this comment.
There may be a bug for when includeAllArgs is true here. 🤔
There was a problem hiding this comment.
I'd love to see all the arguments being forwarded by default. Having to remember to set includeAllArgs and also unpack an array to get at the xhr object is more tedious than it needs to be.
There was a problem hiding this comment.
yeah -- we'd have to update the requestPromise calls to always expect an array
src/sentry/static/sentry/app/api.tsx
Outdated
There was a problem hiding this comment.
this.hasProjectBeenRenamed() expects JQueryXHR as the input; but this cannot be guaranteed.
Introduced in #8799
44ca1ab to
611cafe
Compare
| }; | ||
|
|
||
| type QueryArgs = | ||
| | { |
There was a problem hiding this comment.
Should there be a leading | here?
There was a problem hiding this comment.
I tried to remove it; but prettier seems to be adding this leading |.
src/sentry/static/sentry/app/api.tsx
Outdated
There was a problem hiding this comment.
I'd love to see all the arguments being forwarded by default. Having to remember to set includeAllArgs and also unpack an array to get at the xhr object is more tedious than it needs to be.
7867c8f to
742abeb
Compare
| type RequestCallbacks = { | ||
| success?: (data: any, textStatus?: string, xhr?: JQueryXHR) => void; | ||
| complete?: (jqXHR: JQueryXHR, textStatus: string) => void; | ||
| error?: FunctionCallback; |
There was a problem hiding this comment.
I'm unable to type this properly based on its usage from this file alone. So I'm leaving it as FunctionCallback.
When Sentry is significantly migrated to TS, we can revisit and refine this type.
There was a problem hiding this comment.
Should we be marking things like this somehow?
| IncludeAllArgsType extends true | ||
| ? [any, string | undefined, JQueryXHR | undefined] | ||
| : any | ||
| > { |
There was a problem hiding this comment.
@markstory I'm able to add a conditional type so that the right promise type is returned depending on if includeAllArgs is true.
865c659 to
351ed3e
Compare
|
@dashed is this ready for a final review? |
|
@billyvg not really no. I'm going to take a few more passes on it and then squash my commits. |
0636923 to
b53ae0a
Compare
|
Looks like travis-ci is happy with this one now. @billyvg this PR should be ready to go with the mocks typed. |
918da0b to
4ce9039
Compare
ee2656e to
7ed19f9
Compare
7ecf76c to
09128c5
Compare
NOTES
this.hasProjectBeenRenamed()errorcallback.TODO