atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.78k stars 409 forks source link

Migrating from 2.* to 3.* wipes history #2523

Closed franburstall closed 2 years ago

franburstall commented 2 years ago

Describe the bug

I revisited nyxt for the first time in a while and so built nyxt-3 from master and fired it up:

nyxt -I

On load there was a warning:

<WARN> [14:57:04] Warning: Failed to restore history from /home/fran/.local/share/nyxt/history/default.lisp: Symbol &quot;CURRENT-OWNER-ID&quot; not found in the HISTORY-TREE package. Line: 1580, Column: 14, File-Position: 163363 Stream: #&lt;SB-SYS:FD-STREAM for &quot;file /home/fran/.local/share/nyxt/history/default.lisp&quot; {100A8522B3}&gt;

and, sure enough, my old session from way back was not restored. I opened a site or two and then quit.

I then fired nyxt again and this time the session was restored with the site or two I had opened. On investigation, I discovered that the history file

/home/fran/.local/share/nyxt/history/default.lisp

had been completely overwritten and my old history wiped.

While I expected some friction after such a long time since I last tried nyxt, silently wiping the history is a little unfriendly!

Information

ASDF version: 3.3.1 ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY) Critical dependencies: (/home/fran/common-lisp/nyxt/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd /home/fran/common-lisp/nyxt/_build/cl-gobject-introspection/cl-gobject-introspection.asd /home/fran/common-lisp/nyxt/_build/cl-webkit/webkit2/cl-webkit2.asd)

Output when started from a shell (sbcl:38775): Gtk-WARNING **: 14:57:04.322: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() Nyxt version 3-pre-release-1-273-g5dfb8039

[14:57:04] Source location: #P"/home/fran/common-lisp/nyxt/" [14:57:04] Listening to socket #P"/run/user/1000/nyxt/nyxt.socket". [14:57:04] GTK extensions directory: #P"/home/fran/common-lisp/nyxt/libraries/web-extensions/" [14:57:04] Loading #P"/home/fran/.local/share/nyxt/history/default.lisp". [14:57:04] Warning: Failed to restore history from /home/fran/.local/share/nyxt/history/default.lisp: Symbol "CURRENT-OWNER-ID" not found in the HISTORY-TREE package. Line: 1580, Column: 14, File-Position: 163363 Stream: #<SB-SYS:FD-STREAM for "file /home/fran/.local/share/nyxt/history/default.lisp" {100A8522B3}> [14:57:04] GTK extensions directory: #P"/home/fran/common-lisp/nyxt/libraries/web-extensions/" (WebKitWebProcess:38832): Gtk-WARNING **: 14:57:04.853: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:38832): Gtk-WARNING **: 14:57:04.943: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:38861): Gtk-WARNING **: 14:57:05.069: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:38864): Gtk-WARNING **: 14:57:05.109: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:38861): Gtk-WARNING **: 14:57:05.160: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:38864): Gtk-WARNING **: 14:57:05.194: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() [14:57:16] Loading #P"/home/fran/.local/share/nyxt/bookmarks.lisp". (WebKitWebProcess:39263): Gtk-WARNING **: 14:57:16.790: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:39263): Gtk-WARNING **: 14:57:16.872: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() [14:57:30] Loading "https://duckduckgo.com/?q=twistor%20theory". [14:57:33] Finished loading "https://duckduckgo.com/?q=twistor+theory&ia=web". WARNING: Attributes of # should be a non-dotted alist instead of (("ID" 1033) ("Active buffer" "twistor theory at DuckDuckGo")) [14:58:08] Dark mode enabled. [15:00:14] Emacs mode enabled. [15:00:23] Pressed keys: C-x [15:01:35] Loading "https://duckduckgo.com/?q=twistor+theory&ia=web". [15:01:37] Finished loading "https://duckduckgo.com/?q=twistor+theory&ia=web". [15:01:45] Loading "https://duckduckgo.com/?q=twistor+theory&ia=web". [15:01:46] Finished loading "https://duckduckgo.com/?q=twistor+theory&ia=web". [15:01:49] Loading "https://duckduckgo.com/?q=twistor+theory&ia=web". [15:01:49] Loading "https://duckduckgo.com/l/?uddg=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTwistor_theory¬rut=duckduck_in". [15:01:49] Finished loading "https://duckduckgo.com/l/?uddg=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTwistor_theory¬rut=duckduck_in". [15:01:51] Finished loading "https://en.wikipedia.org/wiki/Twistor_theory". [15:02:11] Dark mode disabled. [15:02:14] Loading "https://en.wikipedia.org/wiki/Twistor_theory". [15:02:15] Finished loading "https://en.wikipedia.org/wiki/Twistor_theory". [15:02:25] Pressed keys: C-x (WebKitWebProcess:50271): Gtk-WARNING **: 15:02:26.681: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() (WebKitWebProcess:50271): Gtk-WARNING **: 15:02:26.763: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not() ; in: ; LAMBDA (&KEY (NYXT/BUFFER-LISTING-MODE::CLUSTER NIL) NYXT/BUFFER-LISTING-MODE::LINEAR-VIEW-P) ; (NYXT:DELETE-BUFFER :BUFFER NYXT:BUFFER) ; ; caught STYLE-WARNING: ; :BUFFER is not a known argument keyword. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition ; in: ; LAMBDA (&KEY (NYXT/BUFFER-LISTING-MODE::CLUSTER NIL) NYXT/BUFFER-LISTING-MODE::LINEAR-VIEW-P) ; (NYXT:DELETE-BUFFER :BUFFER NYXT:BUFFER) ; ; caught STYLE-WARNING: ; :BUFFER is not a known argument keyword. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition ; in: ; LAMBDA (&KEY (NYXT/BUFFER-LISTING-MODE::CLUSTER NIL) NYXT/BUFFER-LISTING-MODE::LINEAR-VIEW-P) ; (NYXT:DELETE-BUFFER :BUFFER NYXT:BUFFER) ; ; caught STYLE-WARNING: ; :BUFFER is not a known argument keyword. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition ; in: ; LAMBDA (&KEY (NYXT/BUFFER-LISTING-MODE::CLUSTER NIL) NYXT/BUFFER-LISTING-MODE::LINEAR-VIEW-P) ; (NYXT:DELETE-BUFFER :BUFFER NYXT:BUFFER) ; ; caught STYLE-WARNING: ; :BUFFER is not a known argument keyword. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition [15:40:39] Deleting socket #P"/run/user/1000/nyxt/nyxt.socket".
aartaka commented 2 years ago

I see, current-owner-id biting us back :/

@Ambrevar, should we re-introduce this slot to not break configs? Or can we somehow configure cl-prevalence to ignore this slot?

Ambrevar commented 2 years ago

Yes, we can specialize the deserializer to ignore the slot for a specific class.

Ambrevar commented 2 years ago

@franburstall The erasing issue should be fixed with 363d13f9b52d9fe43b59d2a1eea85a887a35b7c3: now on error the broken history is backed up (in the same directory). It should be listed with restore-history-by-name.

@aartaka Note that @franburstall 's history file was older than 2.2.4, since the current-owner-node was already deprecated by then. What we use to do is still declare the symbol to be backward compatible, but we've removed it since 3.0 breaks backward compatibility. See commit ac3f55fbbeb714a204917e0f074016512b1ac872.

Let me know if there is anything else, otherwise I believe we can close this issue.

franburstall commented 2 years ago

I confirm that this does as you describe when I load nyxt with a broken history file. Very good! Many thanks.

aartaka commented 2 years ago

@aartaka Note that @franburstall 's history file was older than 2.2.4, since the current-owner-node was already deprecated by then. What we use to do is still declare the symbol to be backward compatible, but we've removed it since 3.0 breaks backward compatibility. See commit ac3f55f.

I mean, mybe we should resurrect and export it, just to make cl-prevalence to not die in agony when it sees current-owner-node etc. Maybe this will even allow using the history from 2. on 3.?

Ambrevar commented 2 years ago

It will. But when do we eventually remove deprecated content?

aartaka commented 2 years ago

Well, if we go with making cl-prevalence to somehow ignore meaningless slots (can we?), then we don't have te remove anything. Then we just ignore this slot, browse the Internet, and overwrite the history file with a new history structure having no deprecated slots at all.

And then this methods listing the meaningful slots can be updated on 4.0, because, by that time, most of people using Nyxt have already switched to 3.* and fixed their histories.

Ambrevar commented 2 years ago

Let me see what I can do.

Ambrevar commented 2 years ago

See #2567.

Ambrevar commented 2 years ago

Should be done for real now.