Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm developing a Chrome App which uses HTML5 FileSystem with persistent storage, my data was lost after chrome get restarted, I tested several times, 9 times out of 10 data lost after restart, I have fired an issue on Chromium site, I want to know if there is workaround or something I did mistake. here is my code:

window.webkitRequestFileSystem(window.PERSISTENT, 120*1024*1024, function(fs) {
    function gotFileEntry(fileEntry) {
        fileEntry.createWriter(gotFileWriter, fail);
    }

    function gotFileWriter(writer) {
        writer.onwriteend = function(evt) {
            done && done();
        };      
        writer.write(blob);
    }
    fs.root.getFile(path, {create: true, exclusive: false}, gotFileEntry, fail);
}, fail);

I found a similar question some guy had asked, but I am sure I set quota(120M) big enough. This problem is for Chrome App, for Legacy packaged app, no problem.

UPDATE: Chrome team has confirmed this problem, the patch will land on Chrome 37.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
342 views
Welcome To Ask or Share your Answers For Others

1 Answer

Answer my own question :) I think I found the problem, it does a chrome bug but just happen when you uninstall your app then re-install same app without restart chrome, for somehow reason, chrome remember the uninstalled apps, it will "delay" to clean up filesystem when chrome next time restarts.

This problem may more serious than you think, if you want the re-installed app works correctly, you have to restart ALL of your computers with same Google account after you uninstall old one at same time, you must make sure all copies are uninstalled from all devices before you re-install, Google will snyc new app to you all devices. otherwise you will get problem when you use that app on one of un-restarted computer.

I have added a comment to my issue to Chrome, wish they will fix it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...