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

Updating PR #190 (ModelSync.Local) with Shifter #385

Closed
wants to merge 8 commits into from
Closed

Updating PR #190 (ModelSync.Local) with Shifter #385

wants to merge 8 commits into from

Conversation

clarle
Copy link
Collaborator

@clarle clarle commented Jan 3, 2013

This is an update/refactor to #190, which has been a stale PR for a while.

It's a few bug fixes I've received from the Gallery version of ModelSync.Local since originally submitting that PR, more complete unit tests, as well as updated Model documentation. I've also updated it to play nicely with Shifter, since the originally PR was submitted while still using the old builder.

I'll be at the roundtable tomorrow, if there's time to discuss it. Thanks!

@jenny
Copy link
Member

jenny commented Jan 3, 2013

Per discussion at 1/3/13 Roundtable, can you add a test for handling full local storage?

@clarle
Copy link
Collaborator Author

clarle commented Jan 4, 2013

@ericf, is expected behavior when localStorage is full to throw an error, or to continue paging in memory?

@ericf
Copy link
Member

ericf commented Jan 5, 2013

@clarle good question. I feel that throwing an error in code running in production is something that we should avoid. This is a good candidate for following prior-art. What do Backbone and Ember Data do in this case?

@clarle
Copy link
Collaborator Author

clarle commented Jan 5, 2013

Backbone.localStorage (https://github.com/jeromegn/Backbone.localStorage) doesn't have a test case for this scenario, opting to leave it to the developer to not have that happen.

Ember Data's localStorage adapter (https://github.com/rpflorence/ember-localstorage-adapter) triggers a QUOTA_EXCEEDED_ERR event, which allows the developer to supply a callback to properly handle it. I think I like this approach, since it gives the most flexibility.

@ericf
Copy link
Member

ericf commented Jan 5, 2013

Yeah, I like Ember Data's approach too, providing the hook will allow the developer to decide and we don't have to do something destructive by default.

@ericf
Copy link
Member

ericf commented Jan 24, 2013

@clare were you still looking into this? Let me know if you have time to implement the exceeding quota exception.

@clarle
Copy link
Collaborator Author

clarle commented Jan 25, 2013

I can get to it during the weekend. Sorry for the delay, it's been busy lately.

@ericf
Copy link
Member

ericf commented Jan 25, 2013

No worries, thanks.

@clarle
Copy link
Collaborator Author

clarle commented Feb 12, 2013

Sorry for the delay on this, and I understand if it doesn't make it in for the PR feature-complete deadline.

There's no way I could find to fully simulate a DOMException, which the QUOTA_EXCEEDED_ERR is one of, but I added a test case that generates an exception during the _save method, which writes the data into localStorage. I can't think of any other possible way to generate a real QUOTA_EXCEEDED_ERR without actually filling up localStorage.

This particular test case should be enough to represent that scenario though.

@ericf
Copy link
Member

ericf commented Feb 12, 2013

Thanks @clarle! I'll be reviewing this for inclusion in 3.9.0, finally :)

@clarle
Copy link
Collaborator Author

clarle commented Feb 12, 2013

I haven't attached the build files, but let me know if you need anything else. Cheers!

@ericf
Copy link
Member

ericf commented Feb 15, 2013

Working on merging this into dev-3.x now…

@ericf
Copy link
Member

ericf commented Feb 16, 2013

Spent some time trying to get this merged in, but the tests are failing in IE6–8. I have to hold off on merging until that is resolved.

@clarle
Copy link
Collaborator Author

clarle commented Feb 16, 2013

I understand, and I'll see what I can do to get it in for the next cycle. Sorry for taking up your time, and I'll do more testing on the lower IE versions as soon as I can.

@ericf
Copy link
Member

ericf commented Feb 17, 2013

@clarle we can coordinate on it. IE 9 & 10 worked great, IE 8 has some weird issue I could figure out what was causing it, and IE 6 had a lot of test failures. I also have some other minor changes locally. On Tuesday morning (Monday is a holiday for us) I'll issue a pull request to you with my tweaks.

@clarle
Copy link
Collaborator Author

clarle commented Feb 24, 2013

@ericf Sorry if you're busy, but could I look at the tweaks sometime? I've been spinning up some IE VMs, and I see the problems that you were talking about.

@clarle
Copy link
Collaborator Author

clarle commented Jun 27, 2013

Closed due to staleness for now.

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

3 participants