Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last entered version #18

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

brettz9
Copy link
Contributor

@brettz9 brettz9 commented Apr 21, 2016

I have a need for entering versions out of order.

Building on the previous PRs, I've added a new method lastEnteredVersion for internal use (and for extending classes) to get the current version (i.e., not necessarily the highest version, but the last used), and modified the existing version(), but this is not really a breaking change since version() would simply throw previously if one tried to enter versions out of order. This method still provides the desired behavior when used as a getter to return the highest version.

@alekseykulikov
Copy link
Contributor

alekseykulikov commented Apr 21, 2016

Man, you did a tremendous job. Thank you! I will try to review on the end of next week. Sorry for delay, having rough deadlines on work.

@brettz9 brettz9 force-pushed the lastEnteredVersion branch 3 times, most recently from b0d5e04 to ce198d3 Compare April 22, 2016 03:01
@brettz9
Copy link
Contributor Author

brettz9 commented Apr 22, 2016

Thanks for your encouragement! I sent one more PR through for when things free up for you...

…allow a sequence of upgrades which can support promises returned by `addCallback` callbacks (and add docs and tests for multiple promise-based callbacks on different versions);

Commenting: Indicate specific Safari bug within code;
Refactoring: Use ES6 `Array.from`; add `Number.isInteger` and ES7 `Object.values()` in place of npm modules (requires babel-polyfill);
Testing: Split off local testing from Sauce; prevent blocking; increase timeout for Firefox; add test to throw with previous version
…ted `addCallback` ones, can themselves use idb-schema methods (e.g., to convert from JSON to idb-schema) though, since they execute within `upgradeneeded` cannot support Promises (as can the callbacks within `addCallback` when `schema.open` or `schema.upgrade` are used); document
… added previously)

- If `delStore` does throw later (or if there is any other upgrade error), the error can be caught by `callback` or `open`/`upgrade`
- Feature: Support `errBack` to `callback`
- Expand callback, delStore docs
… at run-time);

Fix: Allow stores and indexes to be an empty string;
Fix: allow empty-string key path (unless with autoIncrement);
Fix: disallow autoIncrement with array keyPath but enable for non-empty strings (as permitted by spec--keys overridable on put()/add())
Testing: Add tests for above
…n so that one can delete old stores or indexes and recreate them if desired (add tests);

- Refactoring: Put schema.open/schema.upgrade tests in own "describe" section
… order,

  but the getter will continue to get the highest version. To get the current
  rather than highest version, the method `lastEnteredVersion()` has been
  added.
- Refactoring: better default behavior for getJSONStorage internal method
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.

None yet

2 participants