After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764101 - Epiphany only saves 1 window in the session_state.xml
Epiphany only saves 1 window in the session_state.xml
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
3.20.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-23 19:05 UTC by Andres Gomez
Modified: 2016-03-29 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
session: Fix saving of multiple windows (1.63 KB, patch)
2016-03-24 01:45 UTC, Michael Catanzaro
committed Details | Review
session: Fix typos (1.02 KB, patch)
2016-03-24 01:45 UTC, Michael Catanzaro
committed Details | Review

Description Andres Gomez 2016-03-23 19:05:11 UTC
Most probably, a regression because of bug 761811.

Epiphany 3.20.0 and WebKit 2.12.0

I'm running Epiphany with the dconf key:

"process-model" = "shared-secondary-process"

The compilation was done with CMake args:

'-DPORT=GTK -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-O0 -g1 -DNDEBUG -DG_DISABLE_CAST_CHECKS" -DCMAKE_CXX_FLAGS_RELEASE="-O0 -g1 -DNDEBUG -DG_DISABLE_CAST_CHECKS"'


---

1. Open Epiphany.
2. Open more than one window.
3. Quit Epiphany.

When reopening Epiphany, only one of the previously opened windows will be restored. Upon checking the session_state.xml file we can see that only one of the windows was written in the file.

I've also confirmed the same behavior with:
"process-model" = "one-secondary-process-per-web-view"
Comment 1 Michael Catanzaro 2016-03-24 00:00:55 UTC
c45ae0b29287353f3798428b7131d8ac2127da62 is the first bad commit
commit c45ae0b29287353f3798428b7131d8ac2127da62
Author: Carlos Garcia Campos <cgarcia@igalia.com>
Date:   Thu Jan 14 17:59:13 2016 +0100

    ephy-session: save and restore web view session state
    
    Using the new WebKit API available in 2.11.3. The session state is
    serialized and then encoded as Base-64 to be able to to save it in our
    current session state XML file. Now, we always save the session on
    close, since there are more things that might have changed in the state
    like the scroll position that we don't monitor to schedule saves.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=119432

Hard to see what's wrong though....
Comment 2 Andres Gomez 2016-03-24 00:19:39 UTC
(In reply to Andres Gomez from comment #0)
> Most probably, a regression because of bug 761811.

Copy and paste mistake. I was meaning 747860. Anyway, Michael found the regression commit ...
Comment 3 Michael Catanzaro 2016-03-24 01:45:13 UTC
Created attachment 324638 [details] [review]
session: Fix saving of multiple windows

This regressed when we changed ephy_session_close to always save the
session, even if a save was already in progress. In general that is
fine, but it's broken in case a close has already occurred. The problem
is that we actually close twice: once in ephy_shell_close_all_windows,
and then again once for the last window in ephy_window_close. When
closing the last window, other windows have already been closed, and
therefore do not get saved. We need to keep the check here though, to
keep session save working in the general case when closing a single
window with the close button or Ctrl+W, where
ephy_shell_close_all_windows never gets called. So the easiest way to
fix this is to simply tolerate multiple calls to ephy_session_close, and
bail early if the session was already closed; this ensures that we do
not clobber the session state file when closing the final window if the
session was closed by ephy_shell_close_all_windows.
Comment 4 Michael Catanzaro 2016-03-24 01:45:17 UTC
Created attachment 324639 [details] [review]
session: Fix typos

Really ought to use __FUNCTION__ for these instead....
Comment 5 Carlos Garcia Campos 2016-03-29 06:41:45 UTC
Comment on attachment 324638 [details] [review]
session: Fix saving of multiple windows

Ok
Comment 6 Michael Catanzaro 2016-03-29 18:25:51 UTC
Attachment 324638 [details] pushed as 019ac9b - session: Fix saving of multiple windows