Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.16.0 RC2] Stuck at downloading 100% #8308

Closed
sciurius opened this issue Apr 24, 2021 · 29 comments · Fixed by #8630
Closed

[3.16.0 RC2] Stuck at downloading 100% #8308

sciurius opened this issue Apr 24, 2021 · 29 comments · Fixed by #8630

Comments

@sciurius
Copy link

Steps to reproduce

  1. Download a file
  2. Update the file on the server
  3. Client will automatically download the (new) file, a (silent) notification appears

Expected behaviour

  • File is downloaded
  • The notification disappears upon completion

Actual behaviour

  • File is downloaded
  • The notification stays and cannot be dismissed. A reboot is necessary to get rid of it.

Can you reproduce this problem on https://try.nextcloud.com?

I don't think it is server related.

Environment data

Android version: 10

Device model: Samsung Galaxy Note S4

Stock or customized system: Stock.

Nextcloud app version: 3.16.0 RC2.

Nextcloud server version: 21.0.1

stuck

@tobiasKaminsky
Copy link
Member

Related to #8189

@danielb42
Copy link

The 3.16.0 release just came along and I'm experiencing this bug now on Samsung A41/Android 10/OneUI 2.5.

@fjacobi
Copy link

fjacobi commented May 6, 2021

Same here with 3.16.0 on Samsung S10/Android 11/OneUI 3.1

@Luxamman
Copy link

Luxamman commented May 8, 2021

Same problem Android 11 on Google Pixel 3, everything up to date.

@Borroot
Copy link

Borroot commented May 12, 2021

Same problem on an Android 11, One UI 3.1 up to date Samsung Galaxy A50, Nextcloud version 3.16.0.

@dakontiva
Copy link

I am also facing this issue on Android 11, pixel 2 xl, nextcloud client 3.16. Until this is fixed is there any workaround to get rid of that notification without having to reboot?

@danielb42
Copy link

danielb42 commented May 12, 2021

@dakontiva rebooting only helps until the next download anyway. I had to disable Nextcloud notifications completely in Android settings.

@tobiasKaminsky have you seen us?

@Borroot
Copy link

Borroot commented May 12, 2021

You can disable just the "Download notification channel" under the notification settings (in the Android settings menu) for Nextcloud @dakontiva this way you won't see the download notifications anymore.

@af7567
Copy link
Contributor

af7567 commented May 12, 2021

This issue seems to be caused by the removal of these lines which cancelled the notification when the download had ended:

if (mNotificationManager != null) {
mNotificationManager.cancel(R.string.downloader_download_in_progress_ticker);
}

In the old code the notification was always cancelled and then a new notification created if an error needed to be displayed.
Currently it seems to still create a new notification for an error but never cancels the "Downloading..." notification.

edit: I just thought, maybe the intention behind removing the notification cancel was so that the user would later be able to see what files had downloaded in the background. In which case the notification would need setOngoing(false) setting after the download finished otherwise the user can never clear it :)

@Michele64
Copy link

Same here OnePlus 5t, app version 3.16.0

@AndyScherzinger
Copy link
Member

@af7567 the changes are #7949 and #8187 and might still need some edge cases to cover to work properly. The reason we changed it is what you discribed "notification spamming" when you upload a lot of files which. @newhinton might be able to provide some insight.

@af7567
Copy link
Contributor

af7567 commented May 17, 2021

I did wonder if it was to do with multiple file downloads when I looked at it a bit more. I also found that the code to cancel the notification is still there, it has just been moved to the handleMessage method.
This works fine when the app is open and the sync button is tapped. But when the app is closed and the download happens in the background then the background service seems to get destroyed before the delayed Runnable gets run.

(new Handler()).postDelayed(new Runnable(){
public void run() {
if(!mService.mStartedDownload){
mService.mNotificationManager.cancel(R.string.downloader_download_in_progress_ticker);
}
}}, 2000);

I stuck a log message in the code just before line 426 and can see from logcat that 2 seconds doesn't pass before it gets destroyed.

2021-05-17 13:13:52.471 6786-7696/com.nextcloud.client E/handleMessage: Starting delayed runnable
2021-05-17 13:13:52.471 6786-7696/com.nextcloud.client D/FileDownloader: Stopping after command with id 1
2021-05-17 13:13:52.478 6786-6786/com.nextcloud.client V/FileDownloader: Destroying service

I tried adding a 3 second delay to onDestroy and that "fixes" it, but is probably not the right way to do it :) Is there some way to get onDestroy to check for that delayed runnable and wait for it? Or maybe just check for any notifications that need to be cancelled during onDestroy.

@AndyScherzinger
Copy link
Member

Not a big expert in lifecycles, halting onDestroy seems rather wrong, not sure when Android OS would kill the app or fies an ANR or something. @newhinton @tobiasKaminsky any ideas?

@WhiteSockedDancer
Copy link

Same here on Galaxy S20 FE
Nextcloud Version: 3.16.0

@ghost
Copy link

ghost commented May 21, 2021

Same in my Samsung A51, Android 11, nextcloud 3.16.0

Anyhow I'd like to mention I did not start any download but have the situation described above from different users

@tim427
Copy link

tim427 commented May 22, 2021

Same here on Samsung S10, Android 11 (1st of April security patches), OneUI 3.1 and Nextcloud 3.16.0.

Killing the app to get rid of the notification and starting again helps ;)

@Buntbart
Copy link

Buntbart commented Jun 6, 2021

Same here. Meanwhile we have 3.16.1 but this annoying bug is still there...

@cw-jezmckinley
Copy link

@sciurius you can use a Task manager (I use 3C) to kill nextcloud rather than reboot as a workaround till the fix goes live.

@newhinton
Copy link
Contributor

I may have a solution, moving the stopForeground method into the handler. In theory this should allow the service to clean up properly without breaking itself. However, since it is the background version that does not work, it is rather hard to test, so i will see in a couple hours/days if it worked

@newhinton
Copy link
Contributor

I have used my code for a while now, and it seems to be solved. I will now open a pr to get it fixed!

@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.17.0 milestone Jul 6, 2021
@Alex98234
Copy link

Alex98234 commented Jul 30, 2021

Issue is still present in Nextcloud App Version 3.16.1
Device: Galaxy Tab A7 Wi-Fi (SM-T500)
Android 11

Steps to reproduce:

  1. Edit a file in the "Nextcloud Notes" app
  2. Nextcloud app is stuck at "100% downloading" this file (while the file itself was updated correctly)

@q-wertz
Copy link

q-wertz commented Jul 30, 2021

As I understand it, this comes in version 3.17.0 (according to the milestone of this issue) or 3.18 (according to the merge request that closed the issue)

@mveroone
Copy link

mveroone commented Aug 9, 2021

I can confirm I still have undismissable notifications as of 3.17.0 so i'd say it's for 3.18.0.
Note that ti's the same for "upload failed" notifications, even when the upload was successfuly retried.

@cmprmsd
Copy link

cmprmsd commented Aug 10, 2021

I canceled a sync in progress because it was so damn slow and now I have this persistent notification. There should be a menu that shows all "synced" folders and have an option to unsync it. I have to reset my client now. :/

@danielb42
Copy link

Confirming fixed in 3.17.0

@Sveske-Juice
Copy link

Don't know if this is a separate issue, but i am experiencing a similar problem.

Sometimes I get a persistent notification saying the download progress is 100% completed
nc_notification

When clicking the notification, this is the about from $ logcat

03-08 14:31:46.958 23382 23382 V BaseActivity: onRestart() start
03-08 14:31:46.981 23382 23382 D FileDisplayActivity: onStart() starting
03-08 14:31:46.994 23382 31893 D ExternalLinks: links disabled
03-08 14:31:47.019 23382 23382 V FileDisplayActivity: onResume() start
03-08 14:31:47.019 23382 23382 D FileDisplayActivity: onResume() starting
03-08 14:31:47.022 23382 23382 W OCFileListFragment: You see, that is not a directory -> [id=51, name=Passwords.kdbx, mime=application/x-kdbx, downloaded=true, local=/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/REDACTED@redacted.duckdns.org%2Fnextcloud/Documents/NEXT/Passwords.kdbx, remote=/Documents/NEXT/Passwords.kdbx, parentId=25, etag=8fd4e957ce8c10d35324efd8d83161f7, favourite=false]
03-08 14:31:47.023 23382 23382 D FileDataStorageManager: getFolderContent - start
03-08 14:31:47.030 23382 28906 D TrafficStats: tagSocket(6) with statsTag=0xffffffff, statsUid=-1
03-08 14:31:47.037 23382 23382 D FileDataStorageManager: getFolderContent - finished
03-08 14:31:47.047 23382 23382 V FileDisplayActivity: onResume() end
03-08 14:31:47.060 23382 28878 E OpenGLRenderer: Unable to match the desired swap behavior.

Notice the line

W OCFileListFragment: You see, that is not a directory -> [id=51, name=Passwords.kdbx, mime=application/x-kdbx, downloaded=true, local=/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/REDACTED@redacted.duckdns.org%2Fnextcloud/Documents/NEXT/Passwords.kdbx, remote=/Documents/NEXT/Passwords.kdbx, parentId=25, etag=8fd4e957ce8c10d35324efd8d83161f7, favourite=false]

The download was initiated by: https://f-droid.org/packages/com.kunzisoft.keepass.libre/ (password manager app)

System info

nextcloud client: v3.28.0, from f-droid
android: 13
LineageOS: 20.0-20240212-nightly-lemonadep

@Langenhornmarkt
Copy link

Langenhornmarkt commented Mar 8, 2024

I´m experiencing the same issue as @Sveske-Juice on the most recent version of the android app
(ironically with a .kdbx file aswell though i doubt it matters... I just wanted to mention it)

@Grocel
Copy link

Grocel commented Mar 9, 2024

Using Nextcloud together with Keepass files (.kdbx) is a popular use case, isn't it? I got that issue too.

@devloberto
Copy link

devloberto commented Aug 4, 2024

Using Nextcloud together with Keepass files (.kdbx) is a popular use case, isn't it? I got that issue too.

Yeah I guess it is. And unfortunately I'm still facing that annoying notifications quite often.
Screenshot_20240804-032600_Privacy Browser
Nextcloud Android app version 3.29.1
Shift 6mq axolotl
Android version 12
LineageOS version 19-20230104-microG-axolotl
Nextcloud server version 28.0.5
php 8.1.28
mariadb 10.11.4

tbh I do not understand why this issue is marked as closed... which versions do I have to run to get rid of that problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.