0xf104a / NextcloudServices

Android app to send notifications from Nextcloud without using GCM(Google cloud messaging)
GNU General Public License v3.0
63 stars 11 forks source link

`checkNewNotifications()` does not work with more energy-efficient HEAD requests in SSO service #68

Open 0xf104a opened 10 months ago

0xf104a commented 10 months ago

The following error occurs during call to checkNotifications() which is used for traffic-efficient notifications check(see #62)

2023-11-18 18:50:17.575  6793-6793  Services.S...Controller com.polar.nextcloudservices          D  Got status: Updating settings
2023-11-18 18:50:17.575  6793-6793  Services.S...Controller com.polar.nextcloudservices          D  Component id: 3
2023-11-18 18:50:17.575  6793-6793  Services.S...Controller com.polar.nextcloudservices          D  Component prio: 1
2023-11-18 18:50:17.576  6793-6793  com.nextcl...orkRequest com.polar.nextcloudservices          D  [onServiceConnected] called from Thread: [main] with IBinder [ComponentInfo{com.nextcloud.client/com.owncloud.android.services.AccountManagerService}]: android.os.BinderProxy@2162625
2023-11-18 18:50:17.582  6793-10828 com.nextcl...orkRequest com.polar.nextcloudservices          D  copy data from service finished
2023-11-18 18:50:18.670  6793-1628  NextcloudSSOAPI         com.polar.nextcloudservices          D  lastETag="6cdbe52036a68f47ca9eae0a5c153c02"
2023-11-18 18:50:18.670  6793-1628  NextcloudSSOAPI         com.polar.nextcloudservices          D  mETag=
2023-11-18 18:50:18.670  6793-1628  NextcloudSSOAPI         com.polar.nextcloudservices          D  New notifications found
2023-11-18 18:50:18.670  6793-1628  NextcloudSSOAPI         com.polar.nextcloudservices          D  getNotifications
2023-11-18 18:50:18.673  6793-10835 com.nextcl...orkRequest com.polar.nextcloudservices          D  copy data from service finished
2023-11-18 18:50:18.709  6793-6793  SettingsAc...gsFragment com.polar.nextcloudservices          D  onPause called
2023-11-18 18:50:18.875  6793-1628  System.err              com.polar.nextcloudservices          W  android.os.DeadObjectException
2023-11-18 18:50:18.876  6793-1628  System.err              com.polar.nextcloudservices          W      at android.os.BinderProxy.transactNative(Native Method)
2023-11-18 18:50:18.876  6793-1628  System.err              com.polar.nextcloudservices          W      at android.os.BinderProxy.transact(BinderProxy.java:584)
2023-11-18 18:50:18.876  6793-6793  com.nextcl...orkRequest com.polar.nextcloudservices          W  [onServiceDisconnected] [ComponentInfo{com.nextcloud.client/com.owncloud.android.services.AccountManagerService}]
2023-11-18 18:50:18.876  6793-6793  com.nextcl...orkRequest com.polar.nextcloudservices          D  [onServiceDisconnected] Reconnecting lost service connection to component: [ComponentInfo{com.nextcloud.client/com.owncloud.android.services.AccountManagerService}]
2023-11-18 18:50:18.876  6793-6793  com.nextcl...orkRequest com.polar.nextcloudservices          D  [reconnect] called
2023-11-18 18:50:18.876  6793-6793  com.nextcl...orkRequest com.polar.nextcloudservices          D  [unbindService] Unbinding AccountManagerService
2023-11-18 18:50:18.876  6793-1628  System.err              com.polar.nextcloudservices          W      at com.nextcloud.android.sso.aidl.IInputStreamService$Stub$Proxy.performNextcloudRequestV2(IInputStreamService.java:312)
2023-11-18 18:50:18.877  6793-1628  System.err              com.polar.nextcloudservices          W      at com.nextcloud.android.sso.api.AidlNetworkRequest.performAidlNetworkRequestV2(AidlNetworkRequest.java:313)
2023-11-18 18:50:18.877  6793-1628  System.err              com.polar.nextcloudservices          W      at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:180)
2023-11-18 18:50:18.878  6793-1628  System.err              com.polar.nextcloudservices          W      at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:199)
2023-11-18 18:50:18.886  6793-1628  System.err              com.polar.nextcloudservices          W      at com.polar.nextcloudservices.API.NextcloudSSOAPI.getNotifications(NextcloudSSOAPI.java:73)
2023-11-18 18:50:18.886  6793-1628  System.err              com.polar.nextcloudservices          W      at com.polar.nextcloudservices.Services.PollTask.doInBackground(NotificationService.java:40)
2023-11-18 18:50:18.886  6793-1628  System.err              com.polar.nextcloudservices          W      at com.polar.nextcloudservices.Services.PollTask.doInBackground(NotificationService.java:31)
2023-11-18 18:50:18.886  6793-1628  System.err              com.polar.nextcloudservices          W      at android.os.AsyncTask$3.call(AsyncTask.java:394)
2023-11-18 18:50:18.887  6793-1628  System.err              com.polar.nextcloudservices          W      at java.util.concurrent.FutureTask.run(FutureTask.java:264)
2023-11-18 18:50:18.887  6793-1628  System.err              com.polar.nextcloudservices          W      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
2023-11-18 18:50:18.887  6793-1628  System.err              com.polar.nextcloudservices          W      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
2023-11-18 18:50:18.887  6793-1628  System.err              com.polar.nextcloudservices          W      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
sleibrock commented 6 months ago

Is there any update on this? I'd love to help out if able to. Trying to get my users onboarded and SSO would be nice to have if it works.

0xf104a commented 6 months ago

@sleibrock Hello. Sorry, probably, my issue title was quite misleading. The issue is about that currently due to limitations(or bugs?) of Nextcloud SSO API I can not do efficient checks for notifications(i.e. HEAD-requests which reduce data usage)

sleibrock commented 6 months ago

Thank you, it wasn't clear if this was tied to SSO not functioning, but it appears after a few days of testing that SSO does in fact work for notification polling.