ForNeVeR / Kaiwa

A modern XMPP Web client
MIT License
74 stars 13 forks source link

localStorage is readonly in firefox private browsing mode #67

Open matwey opened 9 years ago

matwey commented 9 years ago

Hello,

When I fill login and password and try to connect to the server, then "Connecting..." text is being shown and nothing else is happening.

In the browser debug console, I see the following:

InvalidStateError
    var request = indexedDB.open('datastorage', this.version);

app.js (строка 61256)

Stack is the following:

[566]</Storage.prototype.open()app.js (строка 61256)
cb = function(err)
[535]</</module.exports.launch/<()app.js (строка 57330)
cb = function(err)
[3]</</</async.series/<()app.js (строка 2115)
fn = null
callback = function(err, v)
[3]</</</_asyncMap/<()app.js (строка 1754)
x = Object { index=0, value=function()}
callback = function(err)
[3]</</</async.eachSeries/iterate()app.js (строка 1654)
[3]</</</async.eachSeries()app.js (строка 1670)
arr = [Object { index=0, value=function()}, Object { index=1, value=function()}, Object { index=2, value=function()}, 3 ещё...]
iterator = function(x, callback)
callback = function(err)
[3]</</</_asyncMap()app.js (строка 1753)
eachfn = null
arr = null
iterator = function(fn, callback)
callback = function()
[3]</</</doSeries/<()app.js (строка 1736)
[3]</</</async.series()app.js (строка 2113)
tasks = [function(cb), function(cb), function(cb), 3 ещё...]
callback = function()
[535]</</module.exports.launch()app.js (строка 57323)
[535]</</<()app.js (строка 57447)
n.Callbacks/j()app.js (строка 2)
l = [Document /chat/, [function(a, b)]]
n.Callbacks/k.fireWith()app.js (строка 2)
a = Document /chat/
b = [Document /chat/, [function(a, b)]]
.ready()app.js (строка 2)
a = undefined
I()app.js (строка 2)

I am running Firefox 40.0.3 and openSUSE 13.2 on x86_64. In the browser config dom.indexedDB.enabled is set to true by default.

vitalyster commented 9 years ago

Still relevant?

matwey commented 9 years ago

Yes, it is

ForNeVeR commented 9 years ago

I have installed OpenSuse 13.2 and kaiwa does perfectly work in out-of-the-box Firefox 33.0. Will update to newer Firefox to check whether is makes difference.

matwey commented 9 years ago

I've tried it with new separate profile and it worked. So, probably some config option affects idexedDB behavior. I'll try to figure out which option.

matwey commented 9 years ago

Please, check that you can reproduce the issue when browser.privatebrowsing.autostart=true

https://bugzilla.mozilla.org/show_bug.cgi?id=781982 could be related

ForNeVeR commented 9 years ago

Great clue. I was able to reproduce your issue simply starting Firefox in private mode with either Windows or Linux version.

Firefox private mode is a valid use case for Kaiwa and I will investigate further to fix this problem.

sattellite commented 9 years ago

May be the replacement of the localStorage with localForage will help solve the problem?

ForNeVeR commented 8 years ago

@ForNeVeR go check the upstream fix https://github.com/digicoop/kaiwa/commit/2c6af7111b670d5a6e2d854274419147c6ddbfc5

ForNeVeR commented 8 years ago

@sattellite thank you for suggestion, but it will not help. Try to visit this link with FF in private mode. localForage fails absolutely identically to indexedDB.

Currently I'm trying to replace the real indexedDB with fakeIndexedDB but still no luck: Kaiwa uses APIs not supported by it in multiple places. We'll need to replace part of our storage mechanism just to support that use case.

Also, "upstream fix" does not fix anything. Unfortunately.

matwey commented 8 years ago

@ForNeVeR but "upstream fix" still prints informative message instead of hanging, I think it should be cherry-picked anyway.

ForNeVeR commented 8 years ago

It hangs and prints "informative message" :)