nextcloud / nextcloud/cookbook

Prevent browser from falling asleep if app shows recipe

Open
#3,278 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Frontend javascript
Dominant language
HTML
Stars
641
Forks
113
Avg merge
21h 31m
Merged PRs (30d)
26

Description

Description
There is a wake lock in place currently for displaying a recipe.
This fails short in case one of these events happen:

  • The user turns off the display via power button
  • The user switches to another tab
  • The user switches to another application

In either case, the wake lock is released by the OS (at least under Android) and must be re-aquired.

Reproduction
Steps to reproduce the behavior:

  1. Reduce the display turnoff time to the shortest possible time and make sure the display actually turns off
  2. Open a recipe in view mode (at least currently)
  3. Wait and see that the wake lock actually works
  4. Turn off the display and turn it on again. You see the app again
  5. After the turn-off delay the display turns off.

Expected behavior
The turn-off does not depend if the user clicked somewhere unexpected and by accident disabled the wake lock.

Browser
Firefox for Android

Versions
Cookbook version: 0.11.9

Additional point
Ideally the wake log should be extracted into its own composable to be reused by Vue components and stuff whereever needed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the current wake-lock implementation used when displaying a recipe, then inspect how it responds to display, tab, and application visibility changes. Done means the wake lock is reacquired after those events and the logic can be reused by Vue components through its own composable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.