工作灯 - 推送通知注销和闲置后订阅错误 [英] Worklight - Push notification subscribe error after logout and being idle

查看:183
本文介绍了工作灯 - 推送通知注销和闲置后订阅错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

工作灯6.1.0.1(企业版)

我对的是Android 4.4.2运行工作灯混合应用程序。它采用基于适配器的认证最终用户登录/注销,用户订阅成功登录和退订成功的退出后自动推送通知。此外,我用工作灯服务器超时超时用户,但我不将心跳间隔。服务器超时设置为3分钟,用于测试目的。

一切,包括推送通知,伟大工程,直到我按照下列步骤操作:


  1. 启动应用

  2. 登录身份用户(应用程序订阅用户,成功)

  3. 注销

  4. 等候4分

  5. 作为登录用户再次(应用程序订阅用户,失败)

这些步骤产生的logcat以下错误尝试第二次认购时:

  04-16 17:52:43.200:E / NONE(1493):HTTP:// IP地址:10080 /移动/应用/服务/ API /学生/安卓/通知]失败。状态:500,响应:通知令牌未知,订阅Push.StudentPushAlerts失败。

该工作灯开发服务器控制台产生这个错误:

  [错误] FWLSE0020E:Ajax请求例外:通知令牌未知,订阅Push.StudentPushAlerts失败。 [工程移动]
[错误] FWLSE0117E:错误code:1,错误描述:INTERNAL_ERROR,错误消息:FWLSE0069E:小工具请求期间发生内部错误[工程移动]通知道理不明,订阅Push.StudentPushAlerts失败,用户标识{wl_authenticityRealm = NULL,AdapterAuthRealm =(名称:12345678,登录模块:NonValidatingLoginModule),wl_remoteDisableRealm =(名称:空,登录模块:NullLoginModule),wl_antiXSRFRealm =(名称:cq6d0it2a32h7r57a7ineiaku8,登录模块:WLAntiXSRFLoginModule),wl_deviceAutoProvisioningRealm = NULL,wl_deviceNoProvisioningRealm =(名称:d26bdbbb- ffeb-3070-bd5c-cfd407fb89cb,登录模块:WLDeviceNoProvisioningLoginModule),MYSERVER =(名称:1122a30c-992D-464d-a46a-880d20d03eee,登录模块:WeakDummy),wl_anonymousUserRealm =(名称:1122a30c-992D-464d-a46a-880d20d03eee,登录模块: WeakDummy)}。 [工程移动]
                                                                                                           com.worklight.common.log.filters.ErrorFilter

经过大量的试验和错误,我不能获得通过的第二个错误认购如果我登录之间等待时间超过了服务器端的超时值稍大。在这种情况下,服务器超时为3分钟,我等待四分钟始终如一地产生错误。

我试图通过一些小的调整致力于模拟我的应用程序的流量,重现IBM PushNotifications项目样本中这种行为,我不得不添加超时和心跳,使其工作。我也重现错误,但该方案只是与我的类似,所以我怀疑我没有看到全貌。但是,错误是相同的。

IBM的样本,我有工作可以在这里找到:修改IBM样品(GCM ID /键从提供的样本中删除)

我可以通过以下步骤重现错误我修改IBM样品中:


  1. 启动应用

  2. 登录身份用户(onReadyToSubscribe运行,成功,接近警戒)

  3. preSS的订阅按钮(订阅成功)

  4. 注销

  5. 等待10分钟

  6. 登录的用户再次

  7. preSS的订阅按钮(订阅失败)

同样到我的项目,这些步骤产生的logcat以下错误尝试第二次认购时:

  15 04-16:54:06.952:E / NONE(7133):HTTP:// IP地址:10080 / PushNotifications /应用程序/服务/ API / PushNotifications /安卓/通知]失败。状态:500,响应:通知令牌未知,订阅PushAdapter.PushEventSource失败。

该工作灯开发服务器控制台产生这个错误:

  [错误] FWLSE0020E:Ajax请求例外:通知令牌未知,订阅PushAdapter.PushEventSource失败。 [项目PushNotifications]
[错误] FWLSE0117E:错误code:1,错误描述:INTERNAL_ERROR,错误消息:FWLSE0069E:小工具请求期间发生内部错误[项目PushNotifications]通知道理不明,订阅PushAdapter.PushEventSource失败,用户标识{wl_authenticityRealm = NULL,wl_remoteDisableRealm =(名称:空,登录模块:NullLoginModule),wl_antiXSRFRealm =(名称:u7kpkmov3r8259mvu8t0s0h6v6,登录模块:WLAntiXSRFLoginModule),PushAp $ p $掌=(名称:詹姆斯,登录模块:PushAppLoginModule),wl_deviceAutoProvisioningRealm = NULL,wl_deviceNoProvisioningRealm =(名称:0bd1dcc9-2d93-35a4-a216-1ff3b7ba908d,登录模块:WLDeviceNoProvisioningLoginModule),MYSERVER =(名称:詹姆斯,登录模块:PushAppLoginModule),wl_anonymousUserRealm = NULL}。 [项目PushNotifications]
                                                                                                           com.worklight.common.log.filters.ErrorFilter

如果我不登录的订阅每次成功之间的等待时间,即使切换用户。我的应用程序的authenticationConfig.xml是:

 < securityTests>    < mobileSecurityTest NAME =验证-securityTest>
        < testDeviceId provisioningType =无/>
        <为testUser境界=AdapterAuthRealm/>
    < / mobileSecurityTest>
< / securityTests><&领域GT;    <境界的LoginModule =NonValidatingLoginModuleNAME =AdapterAuthRealm>
        <&的className GT; com.worklight.integration.auth.AdapterAuthenticator< /&的className GT;
        <参数名称=登录功能VALUE =Authentication.onAuthRequired/>
        <参数名称=注销功能VALUE =Authentication.onLogout/>
    < /境界>< /领域><&LoginModule的GT;
    <登录模块NAME =NonValidatingLoginModule>
        <&的className GT; com.worklight.core.auth.ext.NonValidatingLoginModule< /&的className GT;
    < /登录模块>< / LoginModule的>


解决方案

这似乎与被记录为APAR的 PI12693 。我们有供这个问题,可以通过打开PMR(为客户提供付费支持)获得修复。

Worklight 6.1.0.1 (Enterprise edition)

I have a Worklight hybrid app running on Android 4.4.2. It uses Adapter-based authentication for end-user login/logout and the user is subscribed to push notifications automatically after successful login and unsubscribed on successful logout. Additionally, I use the Worklight server timeout to timeout the user but I do not set a heartbeat interval. The server timeout is set to 3 minutes, for testing purposes.

Everything, including push notifications, works great until I follow these steps:

  1. Launch app
  2. Login as user (app subscribes user, succeeds)
  3. Logout
  4. Wait 4 minutes
  5. Login as user again (app subscribes user, fails)

These steps produce the following error in Logcat when the subscription is attempted for the second time:

04-16 17:52:43.200: E/NONE(1493): [http://ipaddress:10080/Mobile/apps/services/api/Student/android/notifications] failure. state: 500, response: Notification token unknown, subscribe to Push.StudentPushAlerts failed.

The Worklight Development Server Console produces this error:

[ERROR   ] FWLSE0020E: Ajax request exception: Notification token unknown, subscribe to Push.StudentPushAlerts failed. [project Mobile]
[ERROR   ] FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request  [project Mobile]Notification token unknown, subscribe to Push.StudentPushAlerts failed., User Identity {wl_authenticityRealm=null, AdapterAuthRealm=(name:12345678, loginModule:NonValidatingLoginModule), wl_remoteDisableRealm=(name:null, loginModule:NullLoginModule), wl_antiXSRFRealm=(name:cq6d0it2a32h7r57a7ineiaku8, loginModule:WLAntiXSRFLoginModule), wl_deviceAutoProvisioningRealm=null, wl_deviceNoProvisioningRealm=(name:d26bdbbb-ffeb-3070-bd5c-cfd407fb89cb, loginModule:WLDeviceNoProvisioningLoginModule), myserver=(name:1122a30c-992d-464d-a46a-880d20d03eee, loginModule:WeakDummy), wl_anonymousUserRealm=(name:1122a30c-992d-464d-a46a-880d20d03eee, loginModule:WeakDummy)}. [project Mobile] 
                                                                                                           com.worklight.common.log.filters.ErrorFilter

After much trial and error, I cannot get passed the error on the second subscribe if I wait between logins for a duration slightly greater than the server-side timeout value. In this case the server timeout is 3 minutes and I wait four minutes to produce the error consistently.

I attempted to reproduce this behavior in the IBM PushNotifications project sample by making some minor adjustments to mimick my application's flow, I had to add the timeout and a heartbeat to make it work. I did reproduce the error but the scenario is only similar to mine, so I suspect I am not seeing the full picture. However, the error is the same.

The IBM sample I am working with can be found here: modified IBM sample (GCM id/key removed from provided sample)

I can reproduce the error in my modified IBM sample by using the following steps:

  1. Launch app
  2. Login as user (onReadyToSubscribe runs, succeeds, close alert)
  3. Press the 'Subscribe' button (subscribe succeeds)
  4. Logout
  5. Wait 10 minutes
  6. Login as user again
  7. Press the 'Subscribe' button (subscribe fails)

Similarly to my project, these steps produce the following error in Logcat when the subscription is attempted for the second time:

04-16 15:54:06.952: E/NONE(7133): [http://ipaddress:10080/PushNotifications/apps/services/api/PushNotifications/android/notifications] failure. state: 500, response: Notification token unknown, subscribe to PushAdapter.PushEventSource failed.

The Worklight Development Server Console produces this error:

[ERROR   ] FWLSE0020E: Ajax request exception: Notification token unknown, subscribe to PushAdapter.PushEventSource failed. [project PushNotifications]
[ERROR   ] FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request  [project PushNotifications]Notification token unknown, subscribe to PushAdapter.PushEventSource failed., User Identity {wl_authenticityRealm=null, wl_remoteDisableRealm=(name:null, loginModule:NullLoginModule), wl_antiXSRFRealm=(name:u7kpkmov3r8259mvu8t0s0h6v6, loginModule:WLAntiXSRFLoginModule), PushAppRealm=(name:james, loginModule:PushAppLoginModule), wl_deviceAutoProvisioningRealm=null, wl_deviceNoProvisioningRealm=(name:0bd1dcc9-2d93-35a4-a216-1ff3b7ba908d, loginModule:WLDeviceNoProvisioningLoginModule), myserver=(name:james, loginModule:PushAppLoginModule), wl_anonymousUserRealm=null}. [project PushNotifications] 
                                                                                                           com.worklight.common.log.filters.ErrorFilter

If I don't wait between logins the subscriptions succeed everytime, even with switching users. My application's authenticationConfig.xml is:

<securityTests>

    <mobileSecurityTest name="Authentication-securityTest">
        <testDeviceId provisioningType="none"/>
        <testUser realm="AdapterAuthRealm"/>
    </mobileSecurityTest>
</securityTests> 

<realms>

    <realm loginModule="NonValidatingLoginModule" name="AdapterAuthRealm">
        <className>com.worklight.integration.auth.AdapterAuthenticator</className>
        <parameter name="login-function" value="Authentication.onAuthRequired"/>
        <parameter name="logout-function" value="Authentication.onLogout"/>
    </realm>

</realms>

<loginModules>
    <loginModule name="NonValidatingLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule>

</loginModules>

解决方案

This appears to be related to an existing defect which is documented as APAR PI12693. We have a fix available for this problem which can be obtained by opening a PMR (for customers with paid support).

这篇关于工作灯 - 推送通知注销和闲置后订阅错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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