christianselig / apollo-bugs

A public bug tracker for Apollo, an iOS Reddit app
228 stars 15 forks source link

After playing and closing GIF/video, app prevents phone auto-lock/sleep #789

Open PsukheDelos opened 4 years ago

PsukheDelos commented 4 years ago

Describe the bug After playing GIF/video, app prevents phone auto-lock/sleep when the app is in the foreground.

To Reproduce Steps to reproduce the behavior:

  1. In the iPhone settings. Settings > Display & Brightness > Auto-Lock: 30 seconds.

  2. In the Apollo settings. Settings > Appearance > Post Size: Compact

  3. Completely close Apollo, and reopen.

  4. Without tapping any posts, leave Apollo open to default subreddit (in my testing /r/all) for 30s. It should dim and lock. Sweet, all good so far.

  5. Unlock phone, find a gif post on the default subreddit, and tap to view it. Watch for a moment, then flick it away to dismiss it.

  6. You should be back at the subreddit / post list now.

  7. Wait for >30s. Phone does not dim or go to sleep as expected.

  8. Completely close Apollo, and reopen.

  9. Without opening and gifs or videos, leave Apollo open for 30s. It should dim and lock again, as expected.

This occurs with videos as well.

I suspect a number of issues happening at the moment are related to videos / gifs not being correctly garbage collected / closed / purged from memory. This might explain the issues related to audio from one video playing on top of audio from another video and other crashes users are experiencing.

iOS version: 13.5 Apollo version: 1.8.1 iOS device: iPhone SE (2020) Jailbroken: No Reproducible: Yes

Expected behavior I would expect Apollo to honour a user’s auto-lock preferences after a video / gif has been dismissed and auto-lock accordingly. While a gif or video is being watched in full screen, I would expect the phone to not auto-lock.

If the user has selected Post Size: Large, and gifs/videos are playing inline, but all are muted, I would expect the phone to auto-lock. If the user has unmuted a video/gif with audio then I would expect the phone to not auto-lock. (I’m not sure what the industry standard for this behaviour is, but that would be my personal preference).

Screenshots N/A

Video Bit of a tricky one to record as I can’t do a screen record of the auto-lock portion since it will cut the video off. A bit late in my current time zone (NZ), but if I get a mo tomorrow, I can record the behaviour with another device.

Additional context Smart Rotation Lock: enabled Portrait Lock Buddy: enabled Autoplay GIFs/Videos: WiFi Only (I was still able to replicate with this set to Never) Post Size: Compact (I was able to replicated with this set to Large)

Happy bug hunting mate and good luck! No dramas at all to provide any additional info that might be helpful, just give us a shout, happy to help. Hope all is well and keep up the good work!

mocollin commented 4 years ago

Having same issue. I think somehow the new media player is causing iOS to think a video is playing even when it’s not. This prevents sleep.

PsukheDelos commented 4 years ago

This has been resolved in 1.8.2 🚀

nguyenhm16 commented 3 years ago

I'm still getting this on iPadOS 14.3 and as well as on an M1 MacBook Air running macOS Big Sur 11.1 (where screensaver never kicks in, and when I manually turn on screensaver the screen never powers down even though it's set to do so after 10 minutes of idle)

urda commented 3 years ago

Still happening with the latest versions of Apollo and iOS. Just woke up to my phone battery completely killed because I had nodded off with Apollo open.

This really needs to be corrected.

PsukheDelos commented 3 years ago

Ditto. I thought it has been corrected (and maybe it had), but I'm continuing to see this behaviour.

In some ways this could be considered a health/safety concern. If someone's phone is drained entirely and they rely on it for checking in / Bluetooth contact tracing. Food for thought in that an issue like this can seem innocuous but actually has broader implications.