本地存储(setStorageSync,getStorageSync)相关bug
小米手机MI 5(系统相关截图见最后)出现如下报错:
thirdScriptError APP-SERVICE-SDK:setStorageSync:fail;at pages/entry page lifeCycleMethod onLoad function Error: APP-SERVICE-SDK:setStorageSync:fail at new t (X5JavaBridge-4b749641b6a338c653d0085108b8dc11:6:24163) at c (X5JavaBridge-4b749641b6a338c653d0085108b8dc11:9:25751) at Object._.(anonymous function ) [as setStorageSync] (X5JavaBridge-4b749641b6a338c653d0085108b8dc11:9:27294) at Object.<anonymous> (X5JavaBridge-4b749641b6a338c653d0085108b8dc11:5:28708) at Function.<anonymous> (X5JavaBridge-4b749641b6a338c653d0085108b8dc11:6:10957) at Object.<anonymous> (X5JavaBridge-4b749641b6a338c653d0085108b8dc11:6:17780) at Object.setStorageSync (X5JavaBridge-6579a36f7f861189c7c1daef6baef118:1750:48) at Entry.onLoad (X5JavaBridge-6579a36f7f861189c7c1daef6baef118:5196:32) at X5JavaBridge-6579a36f7f861189c7c1daef6baef118:2316:48 at Array.forEach (native) |
其他问题
1.此手机在__getStorageSync的时候会出现取某个字段多次才能取到__的情况,如
根据getStorageInfoSync获取到的数据如下
{ "currentSize" :2, "limitSize" :10486, "keys" :[ "X-Access-Token" , "env-version" , "home-count-all" , "home-count-new" , "home-count-star" , "myself" ]} |
但是使用getStorageSync取‘X-Access-Token’时取2次(程序记录了这个数据)才能取到
2.此手机出现了__getStorageInfoSync的时候limitSize不等于10240__的情况,以下是2条来自数据库的记录
{
"currentSize"
:0,
"limitSize"
:0,
"keys"
:[]}
{
"currentSize"
:3,
"limitSize"
:10486,
"keys"
:[
"X-Access-Token"
,
"all_clue_change"
,
"env-version"
,
"home-count-all"
,
"home-count-new"
,
"home-count-star"
,
"myself"
,
"new_clue_change"
]}
5 回复