Cordova/Ionic数据库(Web SQL)随机消失 [英] Cordova / Ionic database(Web SQL) disappears randomly

查看:201
本文介绍了Cordova/Ionic数据库(Web SQL)随机消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建的Cordova/Ionic应用程序遇到了一些麻烦.该问题仅出现在一个用户的电话(大约6部不同的电话中)

A Cordova/Ionic app I've built is having a little trouble. The problem is only appearing on one user's phone (out of about 6 different phones)

本质上来说,当随机使用该应用程序时,有时用户会返回到该应用程序以查找数据库/状态完全为空.我有一个函数,他们可以触发向我发送整个数据库,就好像它只是在随机重置自己一样.只需调用一次即可重置数据库,但它位于是/否提示之后,因此我认为这不是用户错误.

Essentially when randomly using the app, sometimes the user will return to the app to find the database / state is completely blank. I have a function that they can trigger to send me the entire db, and it's as if it just randomly resets itself. There is a single call to reset the database, but it is behind a yes/no prompt so I don't think it's user error.

问题在上周已经开始出现,该应用的配置文件(我们正在使用企业部署与测试团队共享该应用).

The problem has pretty started last week, where the provisioning profile of the app (we are using enterprise deployment for sharing the app with the testing team).

配置文件切换是否有可能离开电话,这是数据库变得不稳定的一种有点奇怪的情况?

Is there any chance that that switch of profile could have left the phone is a slightly odd situation where the database could become unstable?

推荐答案

答案简直是愚蠢.

websql数据库的db(并且我可能还假定本地存储)存储在library/caches目录中,该目录不具有持久性.我在很多地方都读过说可以安全使用.

The db of a websql database (and I presume local storage potentially as well) is stored in the library/caches directory, which is not garenteed to be persistent. I had read in a number of places that said it was safe to use.

我花了2个小时才转而使用本机数据库(通过localforage适配器).

It took me 2 hours to switch out to using the native db (via a localforage adapter).

Pouch db还知道如何使用真实的数据库.

Pouch db also knows how to use a real database.

别走这条路.

这篇关于Cordova/Ionic数据库(Web SQL)随机消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆