[GH-ISSUE #496] Inconsistent state when phone sleeps during restore #421

Closed
opened 2026-02-26 01:30:30 +03:00 by kerem · 6 comments
Owner

Originally created by @davidchisnall on GitHub (Nov 16, 2014).
Original GitHub issue: https://github.com/jberkel/sms-backup-plus/issues/496

If the phone goes to sleep before a restore finishes then the 'switch SMS app back to Messages' box doesn't appear and, if you switch it back manually, then it only shows some messages - in my case only ones from August 2012 and earlier (my last backup was March 2014). Running restore again and poking the screen periodically to prevent it sleeping seemed to fix everything and my most recent SMS reappeared, but it would be good if users didn't have this 'where have all of my messages gone?!?' panic in the first place...

Presumably the same thing will happen if you lose network connectivity for some other reason.

Originally created by @davidchisnall on GitHub (Nov 16, 2014). Original GitHub issue: https://github.com/jberkel/sms-backup-plus/issues/496 If the phone goes to sleep before a restore finishes then the 'switch SMS app back to Messages' box doesn't appear and, if you switch it back manually, then it only shows some messages - in my case only ones from August 2012 and earlier (my last backup was March 2014). Running restore again and poking the screen periodically to prevent it sleeping seemed to fix everything and my most recent SMS reappeared, but it would be good if users didn't have this 'where have all of my messages gone?!?' panic in the first place... Presumably the same thing will happen if you lose network connectivity for some other reason.
kerem 2026-02-26 01:30:30 +03:00
  • closed this issue
  • added the
    v1.5.6
    label
Author
Owner

@jberkel commented on GitHub (Nov 17, 2014):

yes, i'm a little bit worried, this default sms app switching is a huge hack, with lots of potential problems (message loss if the app is not switched back). But there's no clean way to do this, unless google adds new permissions.

<!-- gh-comment-id:63357721 --> @jberkel commented on GitHub (Nov 17, 2014): yes, i'm a little bit worried, this default sms app switching is a huge hack, with lots of potential problems (message loss if the app is not switched back). But there's no clean way to do this, unless google adds new permissions.
Author
Owner

@davidchisnall commented on GitHub (Nov 18, 2014):

You could solve this specific case by asking for the permission to prevent the phone from sleeping and do that while doing the restore. It wouldn't solve the problem of the network going away, but stashing a local copy of the SMS history before doing anything potentially destructive would at least allow you to restore it if the app crashed or the network died.

<!-- gh-comment-id:63469820 --> @davidchisnall commented on GitHub (Nov 18, 2014): You could solve this specific case by asking for the permission to prevent the phone from sleeping and do that while doing the restore. It wouldn't solve the problem of the network going away, but stashing a local copy of the SMS history before doing anything potentially destructive would at least allow you to restore it if the app crashed or the network died.
Author
Owner

@jberkel commented on GitHub (Nov 18, 2014):

ok, currently restore/backup operations already hold a wakelock, but it's only a partial one. maybe it should be enough to convert it to a FULL wakelock for restore, i'll try that.

<!-- gh-comment-id:63471855 --> @jberkel commented on GitHub (Nov 18, 2014): ok, currently restore/backup operations already hold a wakelock, but it's only a partial one. maybe it should be enough to convert it to a FULL wakelock for restore, i'll try that.
Author
Owner

@jberkel commented on GitHub (Nov 18, 2014):

done in github.com/jberkel/sms-backup-plus@6b70acd100

<!-- gh-comment-id:63485150 --> @jberkel commented on GitHub (Nov 18, 2014): done in https://github.com/jberkel/sms-backup-plus/commit/6b70acd100dd68f0974d61eb707d4ad6892a6644
Author
Owner

@jberkel commented on GitHub (Nov 18, 2014):

there's a beta now which holds a full wake lock: https://github.com/jberkel/sms-backup-plus/releases/tag/1.5.6-BETA4

<!-- gh-comment-id:63488511 --> @jberkel commented on GitHub (Nov 18, 2014): there's a beta now which holds a full wake lock: https://github.com/jberkel/sms-backup-plus/releases/tag/1.5.6-BETA4
Author
Owner

@jberkel commented on GitHub (Nov 21, 2014):

closing this, reopen if it didn't work

<!-- gh-comment-id:63963161 --> @jberkel commented on GitHub (Nov 21, 2014): closing this, reopen if it didn't work
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sms-backup-plus-jberkel#421
No description provided.