zapp icon indicating copy to clipboard operation
zapp copied to clipboard

Download stops, when app is in background

Open WebworkrNet opened this issue 4 years ago • 20 comments

Downloads stop as soon as the app is no longer in the foreground.

Android 10 Samsung Galaxy XCover 4s ZAPP 3.6.1

WebworkrNet avatar Apr 23 '21 03:04 WebworkrNet

Thank you for reporting! I'll try to reproduce this on different devices.

cemrich avatar Jun 16 '21 16:06 cemrich

I cannot reproduce this on my devices (Galaxy S7, Android 7 & Poco F1, Android 11). Is anyone else able to reproduce this issue?

@WebworkrNet Is it possible your device has any power saving option enabled that might interfere with the downloads?

cemrich avatar Jun 16 '21 16:06 cemrich

The screenshot shows the current settings. I will turn off the optimization and test again.

20210618_191902

WebworkrNet avatar Jun 18 '21 17:06 WebworkrNet

@WebworkrNet Thanks for your feedback. As background activity is allowed, the download should work just fine... It is the same setting as on my device.

cemrich avatar Jun 19 '21 08:06 cemrich

Ignoring the battery optimization does not bring any improvement.

WebworkrNet avatar Jun 19 '21 13:06 WebworkrNet

@WebworkrNet Thanks for checking that! I'll try to reproduce this issue on an emulator so I am able to fix it.

If anyone else experiences issues with stopped downloads, please leave a comment!

cemrich avatar Jun 19 '21 16:06 cemrich

20210619_010447 20210619_155339 Only briefly displayed PUSH error message: "Connection timed out".

WebworkrNet avatar Jun 19 '21 17:06 WebworkrNet

This bug is only reproducable in release builds and seems to be caused by minifyEnabled true in the manifest. A very dirty quick fix may be to disable minifying - which I want to avoid.

cemrich avatar Oct 14 '21 10:10 cemrich

Stacktrace

java.io.IOException: write failed: EBADF (Bad file descriptor)
	at libcore.io.IoBridge.write(IoBridge.java:540)
	at java.io.FileOutputStream.write(FileOutputStream.java:398)
	at o5.x$a.d(StorageResolverHelper.kt:37)
	at h5.f.m(SequentialFileDownloaderImpl.kt:236)
	at h5.f.run(SequentialFileDownloaderImpl.kt:128)
	at h5.c$a.run(DownloadManagerImpl.kt:103)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:923)
 Caused by: android.system.ErrnoException: write failed: EBADF (Bad file descriptor)
	at libcore.io.Linux.writeBytes(Native Method)
	at libcore.io.Linux.write(Linux.java:293)
	at libcore.io.ForwardingOs.write(ForwardingOs.java:240)
	at libcore.io.BlockGuardOs.write(BlockGuardOs.java:418)
	at libcore.io.ForwardingOs.write(ForwardingOs.java:240)
	at libcore.io.IoBridge.write(IoBridge.java:535)
	at java.io.FileOutputStream.write(FileOutputStream.java:398) 
	at o5.x$a.d(StorageResolverHelper.kt:37) 
	at h5.f.m(SequentialFileDownloaderImpl.kt:236) 
	at h5.f.run(SequentialFileDownloaderImpl.kt:128) 
	at h5.c$a.run(DownloadManagerImpl.kt:103) 
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
	at java.lang.Thread.run(Thread.java:923) 

cemrich avatar Oct 14 '21 11:10 cemrich

It does happen with the same stacktrace when the app is in foreground too, but after a much longer time period.

cemrich avatar Oct 14 '21 11:10 cemrich

Probably the same issue as https://github.com/tonyofrancis/Fetch/issues/594

cemrich avatar Oct 14 '21 12:10 cemrich

This should be fixed in v5.0.1. I'll leave this issue open until I can verify on a breader user basis.

cemrich avatar Oct 14 '21 13:10 cemrich

Sorry, but I can't confirm, that the problem is fixed.

Device: Samsung Galaxy XCover 4s (SM-G398FN) Operating System: Android 11 Zapp: 5.0.2

WebworkrNet avatar Nov 07 '21 09:11 WebworkrNet

Nice, I can't reproduce this with my devices :( Judging from other user feedback, this issue is fixed for most users. But "this issue" may in fact be multiple issues - I cannot tell right now.

cemrich avatar Nov 07 '21 12:11 cemrich

I will keep an eye on it and report back.

WebworkrNet avatar Nov 09 '21 04:11 WebworkrNet

Sorry, but I can't confirm, that the problem is fixed.

Device: Samsung Galaxy XCover 4s (SM-G398FN) Operating System: Android 11 Zapp: 7.0.3

Please, reopen the ticket. Thanks

WebworkrNet avatar Jul 11 '22 08:07 WebworkrNet

An exception is when a live stream is playing in the background at the same time and the screen is then locked by the system (https://github.com/mediathekview/zapp/issues/241). Then the error does not occur.

cemrich avatar Aug 03 '22 12:08 cemrich

Sound like the app gets killed. I suspect the download service.

cemrich avatar Aug 03 '22 12:08 cemrich

The error continues on my new smartphone:

Samsung Galaxy A13 5G (SM-A136B/DSN) Android 12 Zapp 7.0.4 (61)

WebworkrNet avatar Oct 06 '22 14:10 WebworkrNet

An exception is when a live stream is playing in the background at the same time and the screen is then locked by the system (https://github.com/mediathekview/zapp/issues/241). Then the error does not occur.

This is correct.

WebworkrNet avatar Oct 06 '22 14:10 WebworkrNet