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

Version number increasing by multiples of 10 #59

Closed
kamesh-a opened this Issue Jan 16, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@kamesh-a

kamesh-a commented Jan 16, 2015

Hello,

First of all the Dexie.js is awesome, really enjoyed playing with it. Found a bug while trying to do an upgrade event. our upgrade version is lower than indexed Db version. version Dexie created was in multiples of 10

Example :

var db = new Dexie("DexieDBWrapper");
db.version(1).stores({friends: "++id,name,age"});
db.open();

Expected version : 1
Resulted version : 10

code :

var req = autoSchema ? indexedDB.open(dbName) : indexedDB.open(dbName, Math.round(db.verno * 10));

Is this intentional. if so curious to know why.
BTW Great job with Dexie wrapper !!!! Loving it.

Thanks

@dfahlander

This comment has been minimized.

Show comment
Hide comment
@dfahlander

dfahlander Jan 16, 2015

Owner

Thanks!

Yes, it is intentional is something that I regret today because it confuse more than it gives, but I cannot change this beause is would affect all existing implementations.

The reason originally was to be able to workaround a specific upgrading issue that Internet Explorer will fail to remove an object store after having read from it. My idea was to open up for working around the issue by doing the upgrade in two steps when needed. To be able to do that, I needed an intermediate step for upgrading. Instead of multiplying the version number with 2, I choosed to multiply it with 10 because it makes it easier to map it to the real number.

Owner

dfahlander commented Jan 16, 2015

Thanks!

Yes, it is intentional is something that I regret today because it confuse more than it gives, but I cannot change this beause is would affect all existing implementations.

The reason originally was to be able to workaround a specific upgrading issue that Internet Explorer will fail to remove an object store after having read from it. My idea was to open up for working around the issue by doing the upgrade in two steps when needed. To be able to do that, I needed an intermediate step for upgrading. Instead of multiplying the version number with 2, I choosed to multiply it with 10 because it makes it easier to map it to the real number.

@dfahlander

This comment has been minimized.

Show comment
Hide comment
@dfahlander

dfahlander Jan 16, 2015

Owner

I should add that the workaround is not implemented yet, and I will not prioritize it because it applies to a quite rare scenario, when you want to move objects from one store to another and then remove the old store.

Owner

dfahlander commented Jan 16, 2015

I should add that the workaround is not implemented yet, and I will not prioritize it because it applies to a quite rare scenario, when you want to move objects from one store to another and then remove the old store.

@kamesh-a

This comment has been minimized.

Show comment
Hide comment
@kamesh-a

kamesh-a Jan 16, 2015

Thanks @dfahlander for explaining things , I am pretty much interested to use dexie in on my chrome app and node-webkit project. so in case IE workaround is of not needed in my case. Better i would strip off the dependency to make it work for time being, Until the workaround gets implemented.

But another thought now, it if it was issue on IE based on browser impl would have been dealt with that. only IE based would get the 10 multiplier, other browsers might have worked with original version.

that said. Thank you for your quick reply.

kamesh-a commented Jan 16, 2015

Thanks @dfahlander for explaining things , I am pretty much interested to use dexie in on my chrome app and node-webkit project. so in case IE workaround is of not needed in my case. Better i would strip off the dependency to make it work for time being, Until the workaround gets implemented.

But another thought now, it if it was issue on IE based on browser impl would have been dealt with that. only IE based would get the 10 multiplier, other browsers might have worked with original version.

that said. Thank you for your quick reply.

@dfahlander

This comment has been minimized.

Show comment
Hide comment
@dfahlander

dfahlander Jan 16, 2015

Owner

You wouldn't need to strip of anything. You only need to be aware of the version diff in case you migrate to or from Dexie. That's all.

Owner

dfahlander commented Jan 16, 2015

You wouldn't need to strip of anything. You only need to be aware of the version diff in case you migrate to or from Dexie. That's all.

@dfahlander

This comment has been minimized.

Show comment
Hide comment
@dfahlander

dfahlander Mar 15, 2015

Owner

Closing this issue. Documentation has been updated with links to this issue.

Owner

dfahlander commented Mar 15, 2015

Closing this issue. Documentation has been updated with links to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment