Skip to content

Update IndexedDB todo list example to show versionchange and upgradeneeded - #404

Merged
dipikabh merged 4 commits into
mdn:mainfrom
Josh-Cena:todo-list
Nov 6, 2026
Merged

dipikabh merged 4 commits into
mdn:mainfrom
Josh-Cena:todo-list

Conversation

@Josh-Cena

Copy link
Copy Markdown
Member

@Josh-Cena

Copy link
Copy Markdown
Member Author

Pinging @dipikabh

Comment thread to-do-notifications/scripts/todo.js Resolved
Comment thread to-do-notifications/scripts/todo.js Resolved
// Let us open our database
const DBOpenRequest = window.indexedDB.open("toDoList", 4);
// Let us open our database
const dbOpenRequest = window.indexedDB.open("toDoList", 2);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone who previously used this demo may already have a version 4 database, which this version-2 request won't open.
Should we perhaps enhance the error message to explain how to resolve the error (close tabs that may be running the example and delete the existing toDoList database) plus maybe also add a note to the accompanying content page?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should assume that. It would be a huge burden if a demo site has to care about backwards compatibility.

Josh-Cena and others added 2 commits November 4, 2026 12:49
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>

@dipikabh dipikabh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates!

@dipikabh
dipikabh merged commit 06224af into mdn:main Nov 6, 2026
1 check passed
@Josh-Cena
Josh-Cena deleted the todo-list branch November 6, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants