gildas-lormeau/SingleFile · error · Error
error.message + " (Dropbox)"
Error message
error.message + " (Dropbox)"
What it means
In saveToDropbox, when refreshing the Dropbox OAuth token fails with any message other than "unknown_token", the error is rethrown with an " (Dropbox)" suffix and the original as cause. It signals a non-recoverable Dropbox token refresh failure.
Source
Thrown at src/core/bg/downloads.js:574
async function saveToDropbox(taskId, filename, blob, uploadOptions) {
try {
await getDropboxAuthInfo();
const taskInfo = business.getTaskInfo(taskId);
if (!taskInfo || !taskInfo.cancelled) {
return await dropbox.upload(filename, blob, uploadOptions, callback => business.setCancelCallback(taskId, callback));
}
}
catch (error) {
if (error.message == "invalid_token") {
let authInfo;
try {
authInfo = await dropbox.refreshAuthToken();
} catch (error) {
if (error.message == "unknown_token") {
authInfo = await getDropboxAuthInfo(true);
} else {
throw new Error(error.message + " (Dropbox)", { cause: error });
}
}
if (authInfo) {
await config.setDropboxAuthInfo(authInfo);
} else {
await config.removeDropboxAuthInfo();
}
return await saveToDropbox(taskId, filename, blob, uploadOptions);
} else {
throw new Error(error.message + " (Dropbox)", { cause: error });
}
}
}
async function testSkipSave(filename, options) {
let skipped, filenameConflictAction = options.filenameConflictAction;
if (filenameConflictAction == CONFLICT_ACTION_SKIP) {
const downloadItems = await browser.downloads.search({View on GitHub (pinned to 517fb7c5cf)
Solutions
- Reconnect Dropbox in SingleFile options to get fresh auth tokens
- Check error.cause for the OAuth error code (invalid_grant means re-consent required)
- Verify system clock accuracy
- Check https://www.dropbox.com/account/connected_apps and revoke/re-add if stale
Defensive patterns
Strategy: try-catch
Validate before calling
// verify stored Dropbox auth before saving
const authInfo = await config.getDropboxAuthInfo();
if (!authInfo || !authInfo.refreshToken) {
await getDropboxAuthInfo(true); // force interactive re-auth
} Try / catch
try {
await saveToDropbox(taskId, filename, blob, uploadOptions);
} catch (error) {
if (error.message.endsWith('(Dropbox)') && String(error.cause).includes('invalid_grant')) {
await getDropboxAuthInfo(true); // force re-consent
} else { throw error; }
} Prevention
- Reconnect Dropbox in app settings periodically
- Do not revoke SingleFile in Dropbox connected-apps settings
- Keep system clock synchronized
- Treat 'invalid_grant' in error.cause as needing re-consent
When it happens
Trigger: dropbox.refreshAuthToken() rejects during saveToDropbox (called from downloadContent/downloadCompressedContent) with errors like 'invalid_grant'; only 'unknown_token' triggers re-auth.
Common situations: User disconnected SingleFile from Dropbox app connections; refresh token expired; Dropbox app credentials changed; Dropbox API outage.
Related errors
- error.message + " (Google Drive)"
- unknown_token
- error.message + " (GitHub)"
- error.message + " (S3)"
- error.message + " (WebDAV)"
AI-assisted analysis of gildas-lormeau/SingleFile@517fb7c5cf (2026-09-01).
Data as JSON: /api/errors/5d4f42ace38dd0ec.
Report an issue: GitHub.