Fix bugs related to strict privacy settings in browsers#1166
Fix bugs related to strict privacy settings in browsers#1166
Conversation
datenanfragen/website
|
||||||||||||||||||||||||||||
| Project |
datenanfragen/website
|
| Branch Review |
z_indexeddb_bug
|
| Run status |
|
| Run duration | 03m 41s |
| Commit |
|
| Committer | Lorenz Sieben |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
1
|
|
|
8
|
|
|
0
|
|
|
80
|
| View all changes introduced in this branch ↗︎ | |
b26df09 to
29b24bd
Compare
| }; | ||
|
|
||
| export class SavedIdData { | ||
| // Get rid of localforage at some point. |
There was a problem hiding this comment.
Should this be a TODO comment?
| type KeyValueDatabase = IDBPDatabase<{ [key: string]: string }>; | ||
|
|
||
| const errorFilter = (e: Error) => | ||
| // These migh be caused if IndexedDB is disabled in Firefox |
There was a problem hiding this comment.
| // These migh be caused if IndexedDB is disabled in Firefox | |
| // These might be caused if IndexedDB is disabled in Firefox |
| // These migh be caused if IndexedDB is disabled in Firefox | ||
| e.name === 'InvalidStateError' || | ||
| e.name === 'SecurityError' || | ||
| // We couldn’t identify the cause for this error, but it seems to be caused by problem in the browser, so there is |
There was a problem hiding this comment.
| // We couldn’t identify the cause for this error, but it seems to be caused by problem in the browser, so there is | |
| // We couldn’t identify the cause for this error, but it seems to be caused by a problem in the browser, so there is |
| } | ||
| } catch (e) { | ||
| if (e instanceof Error && errorFilter(e)) { | ||
| return; |
There was a problem hiding this comment.
Is there a reason we're returning undefined instead of false here?
| {!navigator.cookieEnabled ? ( | ||
| <div className="box box-info"> | ||
| <Text id="explanation-cookies-disabled" /> | ||
| </div> | ||
| ) : ( | ||
| <></> | ||
| )} |
There was a problem hiding this comment.
| {!navigator.cookieEnabled ? ( | |
| <div className="box box-info"> | |
| <Text id="explanation-cookies-disabled" /> | |
| </div> | |
| ) : ( | |
| <></> | |
| )} | |
| {!navigator.cookieEnabled && ( | |
| <div className="box box-info"> | |
| <Text id="explanation-cookies-disabled" /> | |
| </div> | |
| )} |
|
I've been trying really hard to trigger the errors this PR guards against (by using a build without this changes, of course) but just have not been successful. I've tried (unsuccessfully) to hit the I've also tried to trigger the other errors related to IDB being disabled. Here's what I tried: In Firefox 144.0:
In Tor Browser 14.5.8 (based on Mozilla Firefox 128.14.0esr), using the hosted site:
|
|
I've finally been able to trigger an error in Chromium 141.0.7390.54 (Official Build) snap (64-bit)! In This causes a lot of errors to be thrown when visiting any page: Debug information: {
"message": "Uncaught UnknownError: The user denied permission to access the database.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"code": 0,
"message": "The user denied permission to access the database.",
"description": "Unexpected error while opening IndexedDB in PrivacyAsyncStorage.getDb",
"name": "UnknownError",
"enduser_message": "An unexpected error occured while trying to access the database in your browser.",
"context": {
"options": {
"storeName": "proceedings",
"name": "Datenanfragen.de"
}
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught UnknownError: The user denied permission to access the database.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"code": 0,
"message": "The user denied permission to access the database.",
"description": "Unexpected error while opening IndexedDB in PrivacyAsyncStorage.getDb",
"name": "UnknownError",
"enduser_message": "An unexpected error occured while trying to access the database in your browser.",
"context": {
"options": {
"storeName": "proceedings",
"name": "Datenanfragen.de"
}
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught Error: No available storage method found.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"message": "No available storage method found.",
"description": "Could not retrieve all fixed id_data",
"name": "Error",
"stack": "Error: No available storage method found.\n at driverPromiseLoop (webpack-internal:///./node_modules/localforage/dist/localforage.js:2718:33)",
"context": {
"desc": "Email address"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught UnknownError: The user denied permission to access the database.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"code": 0,
"message": "The user denied permission to access the database.",
"description": "Unexpected error while opening IndexedDB in PrivacyAsyncStorage.getDb",
"name": "UnknownError",
"enduser_message": "An unexpected error occured while trying to access the database in your browser.",
"context": {
"options": {
"storeName": "proceedings",
"name": "Datenanfragen.de"
}
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught UnknownError: The user denied permission to access the database.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"code": 0,
"message": "The user denied permission to access the database.",
"description": "Unexpected error while opening IndexedDB in PrivacyAsyncStorage.getDb",
"name": "UnknownError",
"enduser_message": "An unexpected error occured while trying to access the database in your browser.",
"context": {
"options": {
"storeName": "proceedings",
"name": "Datenanfragen.de"
}
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
}Debug information: {
"message": "Uncaught UnknownError: The user denied permission to access the database.",
"type": "error",
"colno": 5,
"filename": "webpack-internal:///./src/Utility/errors.ts",
"lineno": 47,
"error": {
"code": 0,
"message": "The user denied permission to access the database.",
"description": "Error in doesStoreExist",
"name": "UnknownError",
"enduser_message": "An unexpected error occured while trying to access the database in your browser.",
"context": {
"name": "Datenanfragen.de",
"storeName": "my-requests"
}
},
"defaultPrevented": false,
"eventPhase": 2,
"isTrusted": true,
"returnValue": true,
"code_version": "1.0.0",
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36",
"url": {
"ancestorOrigins": {},
"href": "http://localhost:1314/id-data-controls/",
"origin": "http://localhost:1314",
"protocol": "http:",
"host": "localhost:1314",
"hostname": "localhost",
"port": "1314",
"pathname": "/id-data-controls/",
"search": "",
"hash": ""
}
} |
|
The Chromium "Don't allow sites to save data on your device (not recommended)" problem is not fixed by this PR. |
|
Alright, to summarize:
|


This should also fix the
Error: No available storage method found.that was reported via email several times.