Polyratings / polyratings

Cal Poly SLO Professor Rating Website
GNU Affero General Public License v3.0
15 stars 3 forks source link

Private Browsing Mode on Firefox is Broken #12

Closed AddisonTustin closed 2 years ago

AddisonTustin commented 2 years ago

Browsing the website using Firefox'x private browsing mode currently breaks all functionality. This is because the site's local data storage/caching solution is IndexedDB. For all other browsers, IndexedDB functions properly in private browsing mode, but because of Firefox's security restrictions, it fails to initialize.

See error log below:

Polyratings IndexedDb error: DOMException: A mutation operation was attempted on a database that did not allow mutations. [instrument.js:109:42](https://polyratings.dev/node_modules/@sentry/utils/esm/instrument.js)
    Ob instrument.js:109
    onerror storage.service.ts:30
    (Async: EventHandlerNonNull)
    he storage.service.ts:28
    he storage.service.ts:12
    o index.esm.js:1595
    instanceFromRegistry index.esm.js:1601
    instanceOf index.esm.js:1499
    findAndMakeInstance index.esm.js:1583
    instanceFromRegistry index.esm.js:1593
    instanceOf index.esm.js:1499
    findAndMakeInstance index.esm.js:1583
    get index.esm.js:1475
    cj index.esm.js:1708
    k useService.ts:7
    Ze useAuth.ts:6
    er Navbar.tsx:23
    React 12
    <anonymous> main.tsx:9

A fallback option needs to be provided if indexedDB fails. This can be done in storage.service.ts