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

[Windows] App restarts after waking up from sleep mode #877

Open
MCozhusheck opened this issue Oct 17, 2024 · 10 comments · May be fixed by #1237
Open

[Windows] App restarts after waking up from sleep mode #877

MCozhusheck opened this issue Oct 17, 2024 · 10 comments · May be fixed by #1237
Assignees
Milestone

Comments

@MCozhusheck
Copy link
Collaborator

App go again through setup after waking up from sleep. This cause unnecessary waiting but may also mess up config if something gets overwritten.

This was noticed on my windows laptop but still requires confirmation if it's a common problem

@MCozhusheck MCozhusheck converted this from a draft issue Oct 17, 2024
@MCozhusheck MCozhusheck added this to the 01 Bugs milestone Oct 17, 2024
@brianp
Copy link
Collaborator

brianp commented Nov 21, 2024

Can confirm, i've started seeing this frequently

@Misieq01
Copy link
Collaborator

Misieq01 commented Dec 5, 2024

From what I've tested it looks like it is cause by autoupdate. User put the machine in the sleep mode, when waking up and being on lock screen app detects that update is available and start updating and restarting app, so when user enters password it see app in setup state

@Misieq01
Copy link
Collaborator

Misieq01 commented Dec 9, 2024

@brianp Should I change this behavior somehow ? Like maybe preventing autoupdate in sleep mode or something ?

@brianp
Copy link
Collaborator

brianp commented Dec 9, 2024

Is that something we can detect?

@Misieq01
Copy link
Collaborator

Misieq01 commented Dec 9, 2024

@brianp

use sys_info::{PowerStatus, SystemExt};

fn main() {
    let power_status = PowerStatus::new().unwrap();
    if power_status.is_sleeping() {
        println!("The system is in sleep mode.");
    } else {
        println!("The system is not in sleep mode.");
    }
}

Found something like this

@brianp
Copy link
Collaborator

brianp commented Dec 9, 2024

If the system is asleep, let's do an update check as if the user does not have the auto-update feature turned on.

  1. Check for update
  2. Present a dialog asking if the user would like to update as the upgrade could not be processed while in sleep mode

It's essentially the same process as not having the auto update feature turned on, but the messaging explains why we didn't do the update.

@Misieq01
Copy link
Collaborator

Misieq01 commented Dec 9, 2024

Okay, sounds good

@Misieq01
Copy link
Collaborator

Misieq01 commented Dec 9, 2024

@brianp What do you think maybe about also changing auto update a bit because now if it detects update it proceed with it straight away and new users maybe even don't know what is happening. What about displaying modal with something like "New version detected: Tari Universe 0.9.0. Updating in 5 . 4 . 3 . 2 . 1" and adding button to cancel it

@brianp
Copy link
Collaborator

brianp commented Dec 9, 2024

@Misieq01 having no user interaction on a regular update is by design. It is supposed to be as low a barrier as possible for the update to occur. If auto-update is not turned on, the user receives this dialog to ask if they'd like to update.

When the feature is turned on, it should be seamless.

Except for now, for the machine may be asleep.

@Misieq01 Misieq01 linked a pull request Dec 12, 2024 that will close this issue
@Misieq01
Copy link
Collaborator

@MCozhusheck #1335 was merged, could you test it again and see if issue persist for you ?

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.

3 participants