Merge branch 'bugs-1112-web' into integration
This commit is contained in:
@@ -36,11 +36,12 @@ async function sendUpload(file, {api, prefix='/uploads', startPath=prefix, progr
|
||||
};
|
||||
let id=resume?localStorage.getItem(key):null,state;
|
||||
if(id){
|
||||
try{state=await api(prefix+'/'+id);}
|
||||
try{state=await api(prefix+'/'+id,undefined,{expected:[403,404,410]});}
|
||||
catch(error){
|
||||
// The id was started under another session (a sign-in changes the scope):
|
||||
// the new session does not own it, so this file starts again as a new
|
||||
// upload. A 403/404/410 must never keep the retry on the old id.
|
||||
// The id is only a hint from the last visit. When the upload expired or
|
||||
// was started under another session (a sign-in changes the scope), this
|
||||
// file starts again as a new upload, silently, and its id is replaced.
|
||||
// These refusals are expected here and never reach Sentry.
|
||||
if(![403,404,410].includes(error.status))throw error;
|
||||
id=null;
|
||||
if(resume)localStorage.removeItem(key);
|
||||
|
||||
Reference in New Issue
Block a user