Skip to content

IndexedDB upgradeNeeded not working in stable Chrome #6446

Closed
@DartBot

Description

@DartBot

This issue was originally filed by @sethladd


Consider this code:

  Future<bool> open() {
    Completer completer = new Completer();
    var request = window.indexedDB.open(dbName, version);
    request.on.success.add((e) => _onDbOpened(request.result, completer));
    request.on.error.add(_onError);
    request.on.upgradeNeeded.add((e) => _onUpgradeNeeded(request.transaction));
    return completer.future;
  }

If you compile this to JavaScript and run in Chrome 22, you'll get this error:
 "Uncaught TypeError: Object #<_IDBRequestEventsImpl> has no method 'get$upgradeNeeded' "

Note that our docs show upgradeNeeded as a valid option to use: http://api.dartlang.org/docs/bleeding_edge/dart_html/IDBOpenDBRequestEvents.html

We should polyfill the old setVersion with the new upgradeNeeded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions