Bug 222053 - localstorage randomly unavailable between 2 requests
Summary: localstorage randomly unavailable between 2 requests
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad iOS 14
: P3 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-17 10:56 PST by Luc
Modified: 2021-08-09 11:34 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luc 2021-02-17 10:56:44 PST
Hi, 

I am facing a random issue that I and my team cannot reproduce, but that happens to some of our customers (recorded sessions with logrocket)
It appears only on IOs Safari 14, most often (99%) in-app browser (like Instagram).

Here an example of user agent that get this kind of error: 
-Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 174.0.0.21.119 (iPhone11,8; iOS 14_4; fr_FR; fr-FR; scale=2.00; 828x1792; 271836321)

-Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Mobile/15E148 Safari/604.1


In console logs and javascript mutations logs we can see that:
-the local storage is defined and used in some requests (request headers - x-my-token)
-suddenly, a request (sometimes the same has previously worked) try to use a localStorage value but all values are undefined.

We check in our code, we never override or delete the value of any localStorage value.
There no similar errors in all other browsers.

Here is an url where the bugg appear: https://buy.respire.co/3ffd2486-fa08-4852-8dcc-d99f2a0556a7/

If someone gets the same problems, any help would be greatly appreciated.


Thanks & happy codding
Comment 1 Radar WebKit Bug Importer 2021-02-24 10:57:14 PST
<rdar://problem/74703640>
Comment 2 Mohamed Azmy 2021-03-05 14:23:04 PST
We are having something similar,

We develop Mobile Banking App ... the app has been working for 8 years now and use local storage and recently migrated to WKWebView on iOS and recently in around Last two week of Feb  till now we are seeing random loss of localstorage totally 

This is causing huge issues to the bank customers around 400,000 customers are complaining they are losing their preferences randomly and we need a very urgent fix for this bug 

thanks for a quick answer
Comment 3 Santiago Arriaga 2021-08-09 11:34:07 PDT
We are also facing something similar. Only on Safari 14, and it seems to be totally random. 

As described above, localStorage data is being lost ( sometimes also along with losing web cache data, and sometimes along with CORS errors - that usually fix after restarting the page ). 

Sometimes the issue happens right away when the web page loads, and sometimes after minutes or hours of being working without issues.