Local storage/array losing data

Discussion and feedback on Construct 2

Post » Tue Mar 01, 2016 11:09 am

I think WebStorage is only deprecated because of the Google Play Store. WebStorage uses the real Local Storage or Session Storage as far as I know.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Mar 01, 2016 11:40 am

@Asmodean

Do you know if I can use both? WebStorage to store the array and LocalStorage for the remaining data?
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Tue Mar 01, 2016 1:16 pm

I never tried it, but I don't think that makes a problem, because WebStorage and LocalStorage uses different places to store their data.
But be careful, session storage from WebStorage only lasts with the current browser session, you have to use local storage from WebStorage.
https://www.scirra.com/manual/120/webstorage
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Mar 01, 2016 2:17 pm

Asmodean wrote:I never tried it, but I don't think that makes a problem, because WebStorage and LocalStorage uses different places to store their data.
But be careful, session storage from WebStorage only lasts with the current browser session, you have to use local storage from WebStorage.
https://www.scirra.com/manual/120/webstorage


Ok. Thanks.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Tue Mar 01, 2016 2:45 pm

Asmodean wrote:I never tried it, but I don't think that makes a problem, because WebStorage and LocalStorage uses different places to store their data.

What makes you believe that ?
It uses browser storage. In the absolute, web and local storage store infos at the same place in the browser (not the cache, the storage, a dedicated space for those infos thanks to HTML5 specs).

Moreover, it shouldn't solve the problem of storage files being cleared by the OS.
I don't think using webstorage would help with the issue at hands.

If you could somehow create files on the system and read them, that could be something considered, but I doubt this will be an easy treat, especially on Apple device.
Shaming them for their awful software and asking them to comply better with HTML5 specs could be the only solution around.

But they don't seem to care a lot as per they slow release cycle which goes on breaking previous features.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Tue Mar 01, 2016 3:00 pm

What makes you believe that ?
It uses browser storage. In the absolute, web and local storage store infos at the same place in the browser (not the cache, the storage, a dedicated space for those infos thanks to HTML5 specs).


It all uses the storage of the browser ,but it uses different kind to store the data. LocalStorage uses the IndexedDB, WebStorage uses local storage and session storage.

Moreover, it shouldn't solve the problem of storage files being cleared by the OS.
I don't think using webstorage would help with the issue at hands.


I found out that iOS 8 and 9 has bugs in IndexedDB and WebSQL. So my suggestion was to try WebStorage, because I didn't find a bug report about local storage on iOS 9. I only suggest that he could try, I didn't say that is would fix the problem.


If you could somehow create files on the system and read them, that could be something considered, but I doubt this will be an easy treat, especially on Apple device.
Shaming them for their awful software and asking them to comply better with HTML5 specs could be the only solution around.

But they don't seem to care a lot as per they slow release cycle which goes on breaking previous features.


It is a shame, the bugs are quite old. But it looks Apple don't care about.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Mar 01, 2016 3:07 pm

WebStorage is based on IndexedDB as well.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Tue Mar 01, 2016 3:18 pm

In Chrome I have only a entry in local storage and session storage with WebStorage 'Set local', 'Set session'. The indexedDB is empty.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Mar 01, 2016 3:52 pm

Confirmed. "LocalStorage" uses IndexedDB. "WebStorage" uses LocalStorage - perfectly clear!
ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366

Post » Tue Mar 01, 2016 3:54 pm

@Asmodean, @Kyatric

I'm still making some tests, but so far the data wasn't deleted. I'm using both (local/web storage) as I said before and I didn't see any strange behaviour until now. I'll do some more tests during the day to make sure everything is ok. For while, I'm really grateful for the @Asmodean's suggestion. If I don't come back here is because I hadn't any problem with this solution.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 26 guests