meteor-offline-data icon indicating copy to clipboard operation
meteor-offline-data copied to clipboard

iOS 7 doesn't support shared web workers

Open drgorb opened this issue 11 years ago • 7 comments

as neither iOS nor android support shared workers in the latest version of their browsers (http://caniuse.com/sharedworkers), it would be nice to fallback to dedicated workers instead, as these are supported (http://caniuse.com/webworkers)

drgorb avatar Dec 29 '13 14:12 drgorb

This is actually a big problem. Dedicated workers won't help because the shared web worker is used to communicate between tabs. In other browsers which don't support shared web workers, the browser windows elect one of their number to act as the agent talking to the server, in effect acting like the shared web worker. This doesn't work on iOS because iOS suppresses timer events in inactive tabs.

For a while we were fine because we had one approach which worked on Android and another approach which worked on iOS. Now with iOS 7 neither of the current approaches works.

awwx avatar Dec 30 '13 14:12 awwx

I wrote more about this here: https://github.com/awwx/meteor-offline-data#a-big-problem

awwx avatar Dec 30 '13 14:12 awwx

What if you stored the list of pending requests in LocalStorage (or some other shared storage), then polled it from whichever tab was currently active?

Gaelan avatar Feb 20 '14 16:02 Gaelan

We just started this week with meteor and this news about meteor-offline is actually a showstopper for the framework on mobiles for us. We need an offline mode for the app. It's so close however with a standard single page meteor app. I tested meteor with the parties demo on an android:

made a simple cordova app added the cordova-meteor plugin and just pointed it to my 192.168.1.x:3000 meteor server running in dev mode. And it already actually works almost completely like you want : you can update + add parties both on android and in the browser on the laptop. When offline (wifi off) and it all syncs nicely when you come back online due to latency compensation. So as I see this repo has not had any work on it in the past months due to the shared web workers issue.

Will meteor-offline be possible anytime soon for android+ios? Got any tips or advise to get this working for one or 2 collections alone if the generic way targeted by this plugin is impossible? Or maybe have something that works accept gives warning event when a merge fails and have it up to the developer to make a seperate screen for this (bit like optimistic locking version fail where you have the user resolve the merge by showing the server version of the mongo record).

w-A-L-L-e avatar Mar 07 '14 18:03 w-A-L-L-e

Hi Walter, I'm not currently working on the offline-data package. I suggest:

  • Advocating for offline data on the Meteor roadmap (https://trello.com/b/hjBDflxp/meteor-roadmap)
  • Emailing the meteor-talk group to ask about other offline data approaches and packages (http://groups.google.com/group/meteor-talk)

awwx avatar Mar 07 '14 19:03 awwx

Thanks for the quick reply. Will ask in the groups.

Kind regards, W.

w-A-L-L-e avatar Mar 07 '14 19:03 w-A-L-L-e

It seems that the HTML5 localStorage API actually sends a notification to all open tabs when one of them changes the data. This would mean that timeout events wouldn't be necessary.

According to http://caniuse.com/#search=webstorage it works in 89.35% of all browsers currently in use including all modern ones.

EDIT: This library facilitates this type of messaging.

whmountains avatar Sep 15 '14 17:09 whmountains