Why having a `history-disowned` and a `global-history-source`?

Hi,

As I was trying to develop and test this new feature, I have come across something that I do not understand.

I am not sure this is a bug! It might be expected. This has made things harder for me to test the implementation.

Since I am not sure this is a bug, I will not open an issue on Github. But, in order to be precise, I will use the bug-recipe here (a tweaked version). Moreover, I would like to ask 2 questions about the code behind the phenomena.

Describe the phenomena

After deleting all history entries, the prompt buffer does not show anything else to be deleted. But, if I use the set url, the entries from the deleted history are shown as possible options.

Precise recipe to reproduce the issue

  • be on master commit id edec300ce6175431fe249b54837d243de3aa101b
  • delete-history-entries
  • M-a (select all)
  • return
  • close Nyxt, close emacs, close PC
  • re-start PC, start Nyxt
  • delete-history-entries again, there is nothing there. Ok, expected.
  • Now, try to go to a webpage using C-l (set-url), look at the options, the deleted history entries will be listed. This was a surprise for me. I thought they would be gone.

Information

  • OS name+version: Ubuntu 20.04 LTS
  • Graphics card and driver: product: Iris Plus Graphics 640
    configuration: driver=i915 latency=0
  • Desktop environment / Window manager name+version: Name: GNOME Shell 3.36.7
    Window manager’s “showing the desktop” mode: OFF
  • How you installed Nyxt (Guix pack, package manager, build from source): Source
  • Information from show-system-information:
Nyxt version: 2.1.1-335-gedec300c
Renderer version: GI-GTK
Operating system kernel: Linux 5.8.0-63-generic
Lisp implementation: SBCL 2.0.1.debian (Dynamic space size: 1073741824)
Features: (:WEBKIT2 :WEBKIT2-2.32 :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING
 :WEBKIT2-MUTE :WEBKIT2-EMOJI :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22
 :GTK-3-20 :GTK-3-18 :GTK-3-16 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6
 :GTK-3-4 :GTK :GDK-3-22 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12
 :GDK-3-10 :GDK-3-8 :GDK-3-6 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF
 :GLIB-2-30 :GLIB-2-32 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40 :GLIB-2-42
 :GLIB-2-44 :GLIB-2-46 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54 :GLIB-2-56
 :GLIB-2-58 :GLIB :NYXT-2 :FSET-EXT-STRINGS :CUSTOM-HASH-TABLE-NATIVE
 :PLUMP-UTF-32 :GLOBAL-VARS :DECLARE-TYPES :PARENSCRIPT :NAMED-READTABLES
 :21BIT-CHARS :CHUNGA :FLEXI-STREAMS :CLOSER-MOP :CL-PPCRE-UNICODE :CL-UNICODE
 :CL-PPCRE :BORDEAUX-THREADS :SPLIT-SEQUENCE CHIPZ-SYSTEM:GRAY-STREAMS
 CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO
 :SBCL-USES-SB-ROTATE-BYTE :ASDF-SYSTEM-CONNECTIONS :CL-JSON-CLOS :CL-JSON
 :THREAD-SUPPORT :SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF3.3 :ASDF3.2
 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE
 :X86-64 :64-BIT :ANSI-CL :COMMON-LISP :ELF :GENCGC :IEEE-FLOATING-POINT :LINUX
 :LITTLE-ENDIAN :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB
 :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE :SBCL :UNIX)

ASDF version: 3.3.1
Critical dependencies: (/home/pedro/.quicklisp/dists/quicklisp/software/cl-cffi-gtk-20201220-git/gtk/cl-cffi-gtk.asd
 /home/pedro/.quicklisp/dists/quicklisp/software/cl-gobject-introspection-20210124-git/cl-gobject-introspection.asd
 /home/pedro/common-lisp/cl-webkit/webkit2/cl-webkit2.asd)

Quicklisp dist version: 2021-05-31
Quicklisp client version: 2021-02-13
Local project directories: (/home/pedro/.quicklisp/local-projects/)
Critical dependencies(#<SYSTEM cl-cffi-gtk / cl-cffi-gtk-20201220-git / quicklisp 2021-05-31>
 #<SYSTEM cl-gobject-introspection / cl-gobject-introspection-20210124-git / quicklisp 2021-05-31>
 #<SYSTEM cl-webkit2 / cl-webkit-20210531-git / quicklisp 2021-05-31>)

Output when started from a shell

CL-USER> (nyxt:start)
<INFO> [19:24:59] Listening to socket "/run/user/1000/nyxt/nyxt.socket".
Nyxt version 2.1.1-335-gedec300c
<INFO> [19:24:59] Loading Lisp file "/home/pedro/.config/nyxt/auto-config.lisp".
<INFO> [19:24:59] Loading Lisp file "/home/pedro/.config/nyxt/init.lisp".
NIL
<INFO> [19:25:02] Loading 22 bookmarks from "/home/pedro/.local/share/nyxt/bookmarks.lisp".
<WARN> [19:25:02] History version "2.1.1-7-gefe77e90" differs from current version "2.1.1-335-gedec300c"
<INFO> [19:25:02] Loading history of 64 URLs from "/home/pedro/.local/share/nyxt/history/default.lisp".

==============================

Besides my surprise, I do not understand the “architecture” or “design” behind this history access. I have tried reading the code.

On one hand, delete-history-entries uses history-disowned-source. On the other hand, set-url uses global-history-source.

I have not fully understood those classes by purely reading the code. I must say both classes do not have docstrings.

1 - Why having these 2 approaches to “source” history? Wouldn’t only one be enough?

2 - Since I cannot delete more history nor see more history in GUI to delete, is it expected that I can load things from this undeletable history?

Thanks.

This situation here is different from this bug report. But they might be connected. There I was unable to delete things.

1 Like

I believe this to be a bug.

2 Likes