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

Problem with Roundcube 1.0 and Safari #4619

Closed
rcubetrac opened this issue Jul 23, 2014 · 5 comments
Closed

Problem with Roundcube 1.0 and Safari #4619

rcubetrac opened this issue Jul 23, 2014 · 5 comments

Comments

@rcubetrac
Copy link

Reported by dpc22 on 23 Jul 2014 09:34 UTC as Trac ticket #1489996

We upgraded from Roundcube 0.9.5 to 1.0.2 yesterday. Our helpdesk reports a steady trickle of reports of problems from people running Safari on MacOS and Mobile Safari on iPads and iPhones.

Experiments suggest that it has something to do with "Private Browsing" which is implemented by both Safari and Mobile Safari. This is true of a completely vanilla Roundcube 1.0.2 installation: it isn't a consequence of any change that we have made locally.

Roundcube 1.0 uses Javascript local storage (http://hacks.mozilla.org/2009/06/localstorage/) to store some state on the client computer/device. I think that the original idea which to store draft messages. However it looks like preferences are also stored there.

All well and good, but Safari "Private Browsing" appears to disable local storage.

The Javascript code provided by Roundcube 1.0.2 throws an exception in line 7731 of app.js

 this.local_storage_set_item = function(key, data, encrypted)
  {
    // TODO: add encryption
    return localStorage.setItem(this.get_local_storage_prefix() + key,
                                JSON.stringify(data));
  };

which is a consequence of the following in skins/larry/ui.js :

    // write prefs to local storage
    if (window.localStorage) {
      rcmail.local_storage_set_item('prefs.larry', prefs);
    }

The exception is:

QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.

and this stops Roundcube working at all.

Migrated-From: http://trac.roundcube.net/ticket/1489996

@rcubetrac
Copy link
Author

Milestone changed by @alecpl on 23 Jul 2014 09:46 UTC

later => 1.0.3

@rcubetrac
Copy link
Author

Comment by @thomascube on 23 Jul 2014 10:42 UTC

Seems like a stupid way of Safari to disable localStorage by still exposing the window.localStorage object but setting the quota to 0. However, I suppose wrapping every attempt to read/write from/to localStorage in a try/catch clause should help here.

@rcubetrac
Copy link
Author

Comment by @alecpl on 23 Jul 2014 16:27 UTC

Fixed in b0b9cf0.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 23 Jul 2014 16:27 UTC

new => closed

@rcubetrac
Copy link
Author

Comment by mnpko on 11 Sep 2014 12:10 UTC

Hi, I have changed program/js/app.js and theme file and I am still experiencing problems (no messages) on iphone with private browsing. This do not depend on user account nor messages content.

We have noticed this bug after upgrading from 0.9.x to 1.0.2

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

No branches or pull requests

1 participant