Skip to content

abp.ajax fails silently when jqXHR.status === 0 #9432

Closed
@hillin

Description

@hillin

If I understand correctly, abp.ajax fails silently and leaves a hanging promise when jqXHR.status === 0. According to the comment in the abovementioned code, it is expected that the request is aborted in such case. However,

  • jqXHR.status === 0 can occur in other situations, such as the host is down, or CORS preflight has been rejected. The caller is entitled to know this;
  • It's generally not a good idea to make a promise hanging.

Is it the code was supposed to be like this (which is still not good enough IMO as it still hangs the promise in certain scenarios)?

if(jqXHR.status === 0 && jqXHR.statusText === 'abort')
//                    ↑ && instead of ||

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions