learningequality / learningequality/studio

Gracefully handle IndexedDB connection closing and reopen

Open
#2,861 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2 - normal TODO: needs clarification
Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

Summary

Original issue reported on Slack.

When more than one tab with Studio is opened, it was taking forever to load the channel list.
Nothing was visible in My channels, Starred, and View-only, a part from the loader spinning, and a lot of DexieErrors in the console.
Once I closed the other opened tab as suggested by @kollivier, channel list appeared without issues.

Category

BUG

Usage Details

  • Browser: Chrome
  • Channel: -
  • Topic/Content Item: -

Traceback or relevant snippet from browser console

/en/channels/#/my-channels:1 Uncaught (in promise) 
DexieError {_e: Error
    at getErrorWithStack (https://studio.learningequality.org/static/studio/channel_list-845e…, name: "InvalidStateError", message: "Failed to execute 'transaction' on 'IDBDatabase': … database connection is closing.↵ [object Object]", inner: {…}}
inner: {_e: Error at getErrorWithStack (https://studio.learningequality.org/static/studio/accounts-845ee883…, name: "InvalidStateError", message: "Failed to execute 'transaction' on 'IDBDatabase': …IDBDatabase': The database connection is closing.", inner: DOMException: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.}
message: "Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.↵ InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.↵ [object Object]"
name: "InvalidStateError"
_e: Error at getErrorWithStack (https://studio.learningequality.org/static/studio/channel_list-845ee883853d1392960f.js:1:152009) at new DexieError (https://studio.learningequality.org/static/studio/channel_list-845ee883853d1392960f.js:1:154222) at DexiePromise.rejectionMapper (https://studio.learningequality.org/static/studio/channel_list-845ee883853d1392960f.js:1:255383) at handleRejection (https://studio.learningequality.org/static/studio/channel_list-845ee883853d1392960f.js:1:160790) at nrWrapper (https://studio.learningequality.org/en/channels/:59:26692)
stack: (...)
__proto__: DexieError

How to reproduce

Not able to reproduce it intentionally at the moment, but opening the issue to track if it reappears.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source files, tests, or entry points. Start by tracing the DexieError and IndexedDB connection-closing path in the channel-list loading flow, then reproduce the multi-tab scenario if possible. Done means channel lists load without uncaught connection-closing errors when another Studio tab is open.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
database, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.