mdn / mdn/content

versionchange is super important and hardly is given any attention

Open
#26,639 0 comments 0 reactions 0 assignees View on GitHub
area: IndexedDB Content:WebAPI help wanted
Dominant language
Markdown
Stars
11k
Forks
23.2k
Avg merge
2d 9h
Merged PRs (30d)
331

Description

### MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase

### What specific section or headline is this issue about?

Events/versionchange

### What information was incorrect, unhelpful, or incomplete?

onversionchange is critical and if not implemented can lead to user data corruption or loss. Running different versions in different tabs is a problem and the versionchange event solves this. Not a single thing is mentioned about this except some weak verbage of "An event fired when a database structure change was requested."

### What did you expect to see?

I expect for this critical user data loss subject to be at least mentioned and even better showing some code supporting good practices for multiple tabs being open.

### Do you have any supporting links, references, or citations?

Ivan V. brings focus to this critical topic [Handling IndexedDB Upgrade Version Conflict](https://dev.to/ivandotv/handling-indexeddb-upgrade-version-conflict-368a)

### Do you have anything more you want to share?

The documentation here is pretty weak too. It just casually grazes the subject saying "was requested elsewhere (most probably in another window/tab on the same computer)"
https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/versionchange_event

### MDN metadata

Page report details

* Folder: `en-us/web/api/idbdatabase`
* MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase
* GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/idbdatabase/index.md
* Last commit: https://github.com/mdn/content/commit/89c582f832c8700f7bccef50dabea59350fe3906
* Document last modified: 2023-03-21T06:14:00.000Z

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.