【问题标题】:Worklight: Encrypted Cache size always increasing - destroy not workWorklight:加密缓存大小一直在增加 - 销毁不起作用
【发布时间】:2013-05-13 19:31:23
【问题描述】:

我正在使用WL.EncryptedCache,并且仅在整个用户会话期间保存用户 ID 和密码,并且一旦用户会话过期或用户从应用程序中明确注销,我将使用 WL.EncryptedCache.destroy 销毁加密缓存。

May 13 11:51:55 iPhone CardApp[9836] <Warning>: [LOG] clear badge
May 13 11:51:56 iPhone CardApp[9836] <Warning>: Loading stop
May 13 11:51:56 iPhone CardApp[9836] <Warning>: Original Webview bounds {{0, 0}, {320, 460}}, frame {{0, 0}, {320, 460}}
May 13 11:51:56 iPhone CardApp[9836] <Warning>: tabbar bounds: {{0, 411}, {320, 49}}. WebView bounds: {{0, 0}, {320, 411}}
May 13 11:51:56 iPhone CardApp[9836] <Warning>: [ERROR] Invalid argument value '[object Object]', expected null or 'string'.
May 13 11:51:57 iPhone CardApp[9836] <Warning>: [ERROR] [https://mydomain:443/myApp/apps/services/api/CardApp/iphone/query] exception.
May 13 11:51:58 iPhone com.apple.launchd[1] (UIKitApplication:com.apple.mobilephone[0x2e4d][9804]) <Notice>: (UIKitApplication:com.apple.mobilephone[0x2e4d]) Exited: Killed: 9
May 13 11:51:58 iPhone com.apple.launchd[1] (com.apple.tccd[9805]) <Notice>: (com.apple.tccd) Exited: Killed: 9
May 13 11:51:58 iPhone com.apple.launchd[1] (com.apple.librariand[9840]) <Notice>: (com.apple.librariand) Exited: Killed: 9
May 13 11:51:58 iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
May 13 11:51:58 iPhone com.apple.launchd[1] (com.apple.TextInput.kbd[9823]) <Notice>: (com.apple.TextInput.kbd) Exited: Killed: 9
May 13 11:51:58 iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.apple.mobilephone[0x2e4d]' exited abnormally with signal 9: Killed: 9
May 13 11:51:58 iPhone com.apple.launchd[1] (UIKitApplication:bh.com.my.CardApp[0xf688][9836]) <Notice>: (UIKitApplication:bh.com.my.CardApp[0xf688]) Exited: Killed: 9
May 13 11:51:58 iPhone backboardd[26] <Warning>: Application 'UIKitApplication:bh.com.my.CardApp[0xf688]' exited abnormally with signal 9: Killed: 9
May 13 11:51:59 iPhone DTPower[5858] <Warning>: Task info failed for task bh.com.my.CardApp
May 13 11:52:01 iPhone ReportCrash[9846] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
May 13 11:52:01 iPhone ReportCrash[9846] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2013-05-13-115201.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
May 13 11:53:59 iPhone backboardd[26] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=0
May 13 11:53:59 iPhone backboardd[26] <Notice>: MultitouchHID: detection mode: 0->255

我在 iOS 5 设备中看到的是,本地存储的 App 文件夹(文档和数据)的大小总是在增加。在我的测试中,我首先确保该应用程序已被删除;接下来我安装了它,然后我只登录和注销了三四次......并且缓存大小不断增加。

如前所述,在每次注销时,我都会调用 destroy 方法,并且它会成功执行,因为在销毁之后,如果我搜索键,那么它们不存在,因此被销毁。

最新的 v5.0.6 中是否有任何修复?目前我正在使用 v5.0.5 有解决办法吗?

【问题讨论】:

  • 请发一个例子
  • :[错误] 参数值“[object Object]”无效,应为 null 或“字符串”。你确定销毁调用有效吗?
  • 是的,它被删除了,下次当我搜索以前的键时,它返回null...这意味着它删除了缓存。

标签: ios local-storage ibm-mobilefirst


【解决方案1】:

我使用 Chrome (Windows 7) 在 Worklight 5.0.6.1 中尝试了EncryptedCache sample;我可以在开发工具(>> 资源 >>​​ 本地存储)中清楚地看到,一旦调用 WL.EncryptedCache.destroy,数据就会被删除。

我认为在 iOS 5 或 iOS 6 中应该没有什么不同。

注意:在 iOS 5 中,本地存储被视为可以随时被操作系统删除的临时数据。

【讨论】:

  • 我同意你的观点,因为在 chrome 中我也看到它被删除/覆盖,但在设备上它的行为与我解释的一样!谢谢
  • 您如何/在哪里注意到文件大小的变化?示例应用程序没有做出足够大的更改来实际更改在设置>>常规>>存储>> myapp>>文档和数据大小中可以看到的值。您能附上您的 Worklight 项目吗?
  • 嗨,我如何添加文件?请指导
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-14
  • 1970-01-01
  • 2013-06-29
  • 2016-11-22
  • 2019-08-06
  • 2019-05-02
相关资源
最近更新 更多