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

File system for attachments instead of idb. Orphaned attachment cleanup. Fix for deleting docs with attachments. Additional attachment tests. #115

Closed
wants to merge 7 commits into from

Conversation

chendricks
Copy link
Contributor

No description provided.

@daleharvey
Copy link
Member

Hey Colin, I am going to chop up these commits (the test + stubs) and apply them manually, if could pull in those changes and make a new pull request for the switch to the filesystem api that would be great thanks.

Few comments and nits

We are using 2 space tabs, that needs to stay consistent (try to follow general code styles, spaces around operators, 80 char lines etc)

There are lot of //enbase: comments, not sure what that refers to but it shouldnt be in there

Commented out code shouldnt be committed

Performance tests should be seperated from functional tests, developers should be running the full functional tests suite before every push so putting performance tests in there will be a hassle (you will see in my commit how I split it out)

Thanks a lot for this work

@daleharvey
Copy link
Member

And there is a problem switching to the filesystem api in that firefox doesnt support it

https://developer.mozilla.org/en-US/docs/DOM/File_API/File_System_API

So its pretty unlikely that we can switch to it

@daleharvey
Copy link
Member

Thanks for the rebase

RE: the API discussion, yeh preferably I would like to investigate the IDB performance problems and hopefully see them fixed.

But if it becomes clear that that wont happen any time soon then we can definitely implement this with feature detection (I dont think mozilla is ever planning to implement filesystem api, I think it may even be getting removed from the candidate spec by the w3c)

@chendricks
Copy link
Contributor Author

Sorry for making this pull request from my master. Feel free to reject this one. I have created another based on a branch called FileAPIAttach-Store.

@daleharvey daleharvey closed this Sep 20, 2012
@mudcube
Copy link
Contributor

mudcube commented Oct 12, 2015

Would it be possible for something like this to make it into the release version? This would be very useful for creating apps for iOS/Android using Phonegap/Cordova; the Apache cordova-plugin-file uses the same specs as the HTML5 FileSystemAPI; https://github.com/apache/cordova-plugin-file

The benefit would be unlimited storage in iOS apps (at least for attachments, along with the 50MB limit on JSON entries) without taking the speed hit from using the SQLite plugin.

@nolanlawson
Copy link
Member

@mudcube I think this PR is pretty dead by now (3 years old), but for unlimited storage on iOS there is now the FruitDOWN adapter (https://pouchdb.com/adapters.html#pouchdb_in_the_browser), although it will probably still give you a performance hit because WebKit's IDB implementation is slow.

For storing large binary data on iOS we don't really have a good solution; sorry about that.

@mudcube
Copy link
Contributor

mudcube commented Oct 14, 2015

@nolanlawson Oh, that's totally fine! This project is awesome. I was hoping to help improve the situation with binaries on iOS. Would you be interested in an updated PR request making FileSystemAPI work as an option for developers?

@nolanlawson
Copy link
Member

@mudcube I think at this point it would make more sense to implement it as a separate adapter (ala worker-pouch or socket-pouch), but yeah, that would be awesome. :)

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.

4 participants