Multiple snapshot: Perform periodic session backup and let the user restore a particular backup

NEW
Unassigned

Status

()

--
enhancement
2 years ago
3 months ago

People

(Reporter: cwiiis, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(firefox51 affected)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Usually about every month or so, I manage to lose my session. While the relief of not having the couple of hundred tabs I usually have open hang over me is almost palpable, this is a bit annoying and entirely unnecessary.

At some point, after years of having this problem, perhaps we should concede that it's possible, maybe even through the fault of the user, that their session gets irrecoverably lost. For example, you may accidentally open a window, close your original window with all your tabs, then close the second window. Or you may just get unlucky with a Nightly update.

We should periodically backup the users' session and provide UI to view/restore a particular session backup.
There is already sessionstore-backups folder with a few days of backups. Though I don't believe there is any UI for restoring them.
(Reporter)

Comment 2

2 years ago
(In reply to Kevin Brosnan [:kbrosnan] from comment #1)
> There is already sessionstore-backups folder with a few days of backups.
> Though I don't believe there is any UI for restoring them.

oh wow, really? I should probably look at that...

I think it would be nice if we detect that Firefox starts up with no tabs, or only has a window with one tab open, when last time there was a window open, there were X tabs (>= 5 or something?), we could provide a "Where'd my tabs go?" bubble/pop-down/notification/link/whatever. i.e. if the session is empty when in the last session or two, it was decidedly not-empty, we should take action.
sessionstore-backups indeed keeps a few backups, see https://dutherenverseauborddelatable.wordpress.com/2014/06/26/firefox-the-browser-that-has-your-backup/ for more details. If Session Restore detects that the session has been lost, it automatically falls back to a backup. Currently, we assume that session lost == invalid json, but if you can think of other heuristics, that would be useful, too.
(Reporter)

Comment 4

2 years ago
(In reply to David Rajchenbach-Teller [:Yoric] (please use "needinfo") from comment #3)
> sessionstore-backups indeed keeps a few backups, see
> https://dutherenverseauborddelatable.wordpress.com/2014/06/26/firefox-the-
> browser-that-has-your-backup/ for more details. If Session Restore detects
> that the session has been lost, it automatically falls back to a backup.
> Currently, we assume that session lost == invalid json, but if you can think
> of other heuristics, that would be useful, too.

I guess the problem is cases where the session manages to get emptied (failed or accidentally cancelled recoveries, accidentally closing windows, unforseen conditions, haywire add-ons, etc.) - it would be good if we had some kind of 'soft' recovery option where we could prompt a user that we think maybe they lost their session, but maybe not. Like a bubble or one of those little bars that we use for enabling plugins and such.

My suggested heuristic would be 'current session is empty, a recent (say, within 24 hours) session backup exists'. Under this condition, it would be good to prompt the user that they can restore the non-empty session backup, if they'd like (and if they explicitly cancel, then of course, don't ask again).
Blocks: 1330638
(Reporter)

Comment 5

a year ago
Nightly just lost my session, again.

I actually had a lot of work-related tabs and would like to recover my session - I've backed up my session files, could anyone give some brief instructions on how you go about manually recovering a session?
(In reply to Chris Lord [:cwiiis] from comment #5)
> Nightly just lost my session, again.
> 
> I actually had a lot of work-related tabs and would like to recover my
> session - I've backed up my session files, could anyone give some brief
> instructions on how you go about manually recovering a session?

How about replacing the files mentioned in Yoric's comment 3, with the one you backed up? (When Firefox is not running)

If that doesn't work, extracting URLs from JSON and using "Bulk URL Opener" like add-on might be a less efficient way.
(In reply to Chris Lord [:cwiiis] from comment #5)
> Nightly just lost my session, again.
> 
> I actually had a lot of work-related tabs and would like to recover my
> session - I've backed up my session files, could anyone give some brief
> instructions on how you go about manually recovering a session?

You might want to try the way in bug 1365713 comment 0.
Since the break of the handy extension 'session manager' was introduced by our transition for WebExtension, some of my colleagues(who is either using Nightly or Release version) start to encounter a situation:
1. run into a mysterious session lost (for many possible reasons)
2. but have no 'session manager' to recover.

They might be able to find an old backup in profile folder, but way too old.

Implementing a UI for users to select/restore might not be easy at this moment, we probably could consider implementing a trivial snapshot mechanism which periodically saves session into the profile folder and at least advanced user can find it if they are very painful and eager to recover their working session.

For example, we could save the session every hour (or even every day), and only keep the last 10 sessions to avoid excessive backup files.

I think this can largely ease the pain of users who lost their valuable session.
Summary: It is too easy to lose your session: We should perform periodic session backup and let the user restore a particular backup → Multiple snapshot: Perform periodic session backup and let the user restore a particular backup

Comment 9

11 months ago
Mike, what do you think about the comment 8? 
Is that a bad idea at this moment? :)
Flags: needinfo?(mdeboer)
Hmm, sure, might be something worth having - pref'ed off by default, of course.
Flags: needinfo?(mdeboer)

Comment 11

10 months ago
Created attachment 8924079 [details] [diff] [review]
bug-1298912.patch

Hi Mike,

I already made a patch which done the comment 8, could you help to give feedback? :)

- It's pref'ed off by default
- If enabled, make snapshot every 1 hour
- Keep the last 10 snapshots to avoid excessive backup files

Minor:
- refactor for reusing functions
- remove legacy code

If this patch is OK, I will add more comments and polish it for your review.

(BTW, just for your information, while making this patch, I saw a comment(bug 1201111 comment 1) which raise the similar requirement)
Attachment #8924079 - Flags: feedback?(mdeboer)
Cool stuff! I think it'd be a very good idea to get this in, but I'd really like to add a control interface in about:preferences for this feature as well, because it'd be a shame to have beneath the surface from the start.

I have a number of comments about the implementation of this patch, would you like me to post those here? Or wait for the next iteration?
Attachment #8924079 - Flags: feedback?(mdeboer)
(In reply to Mike de Boer [:mikedeboer] from comment #12)
> Cool stuff! I think it'd be a very good idea to get this in, but I'd really
> like to add a control interface in about:preferences for this feature as
> well, because it'd be a shame to have beneath the surface from the start.
Nice :D
Exposing this feature to about:preferences would be great to many users!
Could you share a bit about your imagination for the control interface?
such as, what kind of options we would like to offer, say:
A = "show your windows and tabs from last time"
B = Multiple snapshots

Possible options:
1. enable both A and B (likely)
2. enable A, disable B (a bit strange?)
3. others?

Besides,
as comment 8 mentioned, implementing a UI for users to select/restore might not be trivial, what do you consider about this part, or did I take it too complicated?


> I have a number of comments about the implementation of this patch, would
> you like me to post those here? Or wait for the next iteration?
I'm more than happy to receive your feedback, which is very valuable to me.
Could you share them with me? Thus I can fix/adjust my patch in the earlier stage :)

Comment 14

7 months ago
> Exposing this feature to about:preferences would be great to many users!

This will be definitely nice to have this option in about:preferences 
But even better would to have it separately, the same way like History or Bookmarks


> Could you share a bit about your imagination for the control interface?
> such as, what kind of options we would like to offer, say:
> A = "show your windows and tabs from last time"
> B = Multiple snapshots
> 
> Possible options:
> 1. enable both A and B (likely)
> 2. enable A, disable B (a bit strange?)
> 3. others?
> 
> Besides,
> as comment 8 mentioned, implementing a UI for users to select/restore might
> not be trivial, what do you consider about this part, or did I take it too
> complicated?


Is it possible at this time to have the following options?:

* setting up the number of sessions stored

* setting up period between session savings

* opening separate window (pop-up or in different tab) showing 
   a) variant A (easier): sessions saved (date, number of windows/tabs)
   b) variant B (better): sessions saved (date) + for each session: list of windows and tabs (like in Session Manager); 
      it should be possible to unclick some windows or tabs
   # it should be possible to delete session or save with generic name
   # option to add saved session (or part - by ) to current session as separate windows or to add tabs to current window

* option to save session at this moment with date or better with chosen name

* option to create button1 next to address bar; this button should open menu with preferences for session restore

* option to create button2 next to address bar; this button should open menu for saving current session

* option if session opening is done using lazy tabs


If you can please, check Session Manager for more ideas.

Thanks

Comment 15

7 months ago
Supplemental information to comment 14 & 13

Related bugs describing the most important futures needed which should be introduced together with Bug 1298912:
Bug 845820
Bug 591957
Bug 1301041
Bug 1421673

Comment 16

7 months ago
(In reply to Robert Ab from comment #15)
> Supplemental information to comment 14 & 13
> 
> Related bugs describing the most important futures needed which should be
> introduced together with Bug 1298912:
> Bug 845820
> Bug 591957
> Bug 1301041
> Bug 1421673

Other important bug:
Bug 590448
You need to log in before you can comment on or make changes to this bug.