Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug: Is deleting all history entries supposed to delete everything in the local history file? #1481

Closed
pdelfino opened this issue Jun 7, 2021 · 12 comments
Labels
bug history Related to history handling.

Comments

@pdelfino
Copy link
Contributor

pdelfino commented Jun 7, 2021

Hi,

I am able to succesfully delete the history in Nyxt with execute-command + delete-history-entry + alt-a (select all) + enter.

After doing this there is nothing showed as history in Nyxt's GUI. However, I can find everything in a local .lisp file at:

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

I am not sure if this is intentional. It might be a bug.

I thought that after deleting on the GUI there would be some sort of "list surgery" and mutation on the history file with the disappearance of the deleted elements.

I came across this after trying to build a humble and local prototype for this "good-first issue" feature.

The process of deleting stuff was done with two version's of Nyxt's GUI. The last stable version offered for download (version-2-pre-release-7) and the current master version 2.0.0-20g664d8953.

The details of my set-up (OS, graphic drivers and et cetera) were provided here.

@aartaka
Copy link
Contributor

aartaka commented Jun 7, 2021

The thing is, we don't modify the file until we need to, and this is done asynchronously (which means that it happens when you don't necessarily expect it to, and is invisible to you).

To get the fresh version of history, always refer to the Nyxt-stored one, e.g., via with-data-unsafe:

(with-data-unsafe (history (history-path (current-buffer)))
  (htree:do-tree (node history)
    (when (> (nyxt::explicit-visits (htree:data node)) 5)
      (bookmark-url :url (url (htree:data node))))))

Even though this seems to load history from a file, this semblance is misleading: it just uses file name as an identifier for Nyxt-internal data.

Long story short, always use Nyxt-internal data (with with-data-unsafe, with-data-access, or, if you need to, with get-data) and never rely on files, because these are only reliable while Nyxt is not running :)

@pdelfino
Copy link
Contributor Author

pdelfino commented Jun 8, 2021

Thanks @aartaka, I tried again and the history file shows that websites accessed before the deletetion process were indeed removed!

When I tried this a few days ago, I even re-started my computer to check it because I thought there could be some asynchronous process going on. Even after the computer re-start, I could still see websites supposed to be deleted there. After the re-start, I think I checked the history file while Nyxt was closed. But I am not sure. However, as I said, the deleted websites are gone on the history file.

How should I proceed after interactions like this happen? Should I close the issue? Should I await for you to close?

Is this the most appropriate place for questions like this one?

Sometimes I am not sure between choosing discourse or github.

@aartaka
Copy link
Contributor

aartaka commented Jun 8, 2021

Thanks @aartaka, I tried again and the history file shows that websites accessed before the deletetion process were indeed removed!

When I tried this a few days ago, I even re-started my computer to check it because I thought there could be some asynchronous process going on. Even after the computer re-start, I could still see websites supposed to be deleted there. After the re-start, I think I checked the history file while Nyxt was closed. But I am not sure. However, as I said, the deleted websites are gone on the history file.

Well, that is bug. I believe that #1492 will resolve that.

How should I proceed after interactions like this happen? Should I close the issue? Should I await for you to close?

If it's resolved — close it. We usually don't close issues for someone, because the person might still have some unresolved details or questions related to the issue.

Is this the most appropriate place for questions like this one?

Sometimes I am not sure between choosing discourse or github.

Questions about expected behavior and inconsistencies with it are for GitHub, because these are potential bugs. The rule I'd stick to is:

  • If it's not critical and can possibly have some rational reasons behind it — Discourse.
  • If it's getting critical/harmful/confusing — Github.

@pdelfino pdelfino closed this as completed Jun 8, 2021
@Ambrevar
Copy link
Member

After the re-start, I think I checked the history file while Nyxt was closed. But I am not sure. However, as I said, the deleted websites are gone on the history file.

Well, that is bug. I believe that #1492 will resolve that.

I'm not sure I understand the issue completely. #1492 only fixes the potential file corruptions. If the history loads fine but entries are missing (or still there while they should not), then this is not related to #1492.

@aartaka
Copy link
Contributor

aartaka commented Jun 10, 2021

After the re-start, I think I checked the history file while Nyxt was closed. But I am not sure. However, as I said, the deleted websites are gone on the history file.

Well, that is bug. I believe that #1492 will resolve that.

I'm not sure I understand the issue completely. #1492 only fixes the potential file corruptions. If the history loads fine but entries are missing (or still there while they should not), then this is not related to #1492.

It may be related, because serialization stops on browser shutdown. This can lead to a non-fresh file info.

But yes, it can actually be a different thing. I'll reopen the issue, just in case.

@aartaka aartaka reopened this Jun 10, 2021
@pdelfino
Copy link
Contributor Author

Hi guys,

I came across this again accidentally as I was doing some tests for issue #1310. I think there is indeed a bug. I will report it here instead of creating a new issue.

Describe the bug

After deleting all history entries with delete-history-entry, M-a (select all), return, quit Nyxt, quit Emacs, re-start PC, re-start Nyxt, some part of history persists. It is not all. It is a small part. You can check out my local history file here.

I cannot delete the following websites:

image

Even after trying to delete everything, after pressing C-l, I can still see 21 URLs as global history:
image

Some of them are in my bookmarklists. They entered there because I was doing experiments for #1310. However, I must highlight that is not exactly the same thing. The websites that persis across deletion are not all the URLs bookmarked.

Some of my bookmarks were added via commands in the REPL (not with the Nyxt's GUI). If you wanna have a look, this is my current local bookmark list file.

Precise recipe to reproduce the issue
(before executing this, maybe you should have a back-up of your history if you care about it)

  • execute command delete-history-entry;
  • select all M-a;
  • press return;
  • quit Nyxt and re-start PC;
  • press C-l to see what are the options and/or
  • execute-command delete-history-entry to see what are the available options.

OS name+version:
Ubuntu 20.04.2 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):
Running from the source fetched/pulled from GitHub today.

Information from command copy-system-information:
Nyxt version: 2.1.0-8-gfd219899
Renderer version: GI-GTK
Operating system kernel: Linux 5.8.0-55-generic
Lisp implementation: SBCL 2.0.1.debian
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 GRAY-STREAMS
FLAT-NAMESPACE X86-64 UNIX CFFI FLAT-NAMESPACE 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

I do not start Nyxt from a shell. I start it inside the SLIME REPL with:

CL-USER> (nyxt:start)
<INFO> [16:39:34] Listening to socket "/run/user/1000/nyxt/nyxt.socket".
Nyxt version 2.1.0-8-gfd219899
<INFO> [16:39:34] Loading Lisp file "/home/pedro/.config/nyxt/auto-config.lisp".
<INFO> [16:39:34] Loading Lisp file "/home/pedro/.config/nyxt/init.lisp".
NIL

@Ambrevar
Copy link
Member

Ambrevar commented Jun 24, 2021 via email

@pdelfino
Copy link
Contributor Author

pdelfino commented Jun 25, 2021

Hi Pierre,

Can you reproduce on master?

Few minutes ago, I deleted everything with delete-history-entry, M-a, return, quit Nyxt, re-start PC, re-start Nyxt, and some web pages persist.

I have just reproduced it running from source under version:

CL-USER> (nyxt:nyxt-version)
<INFO> [21:25:00] Version 2.1.0-8-g7f3d0602

These are the logs:

CL-USER> (nyxt:start)
<INFO> [21:24:22] Listening to socket "/run/user/1000/nyxt/nyxt.socket".
Nyxt version 2.1.0-8-g7f3d0602
<INFO> [21:24:22] Loading Lisp file "/home/pedro/.config/nyxt/auto-config.lisp".
<INFO> [21:24:23] Loading Lisp file "/home/pedro/.config/nyxt/init.lisp".
NIL
<INFO> [21:24:28] Loading 3 bookmarks from "/home/pedro/.local/share/nyxt/bookmarks.lisp".
<WARN> [21:24:28] History version "2.1.0-18-g43a9ad4e" differs from current version "2.1.0-8-g7f3d0602"
<INFO> [21:24:28] Loading history of 58 URLs from "/home/pedro/.local/share/nyxt/history/default.lisp".

@pdelfino pdelfino changed the title Is deleting all history entries supposed to delete everything in the local history file? Possible bug: Is deleting all history entries supposed to delete everything in the local history file? Jun 26, 2021
@pdelfino pdelfino added the bug label Sep 22, 2021
@Ambrevar Ambrevar added the history Related to history handling. label Jun 17, 2022
@aartaka
Copy link
Contributor

aartaka commented Aug 1, 2022

So, it should be fixed with nfiles, right?

@Ambrevar
Copy link
Member

Ambrevar commented Aug 3, 2022

I initially couldn't reproduce, so my guess is that it was a race condition in data-storage which should be fixed with nfiles, yes.

@pdelfino Can you reproduce?

@aadcg
Copy link
Member

aadcg commented May 31, 2023

Stale.

@aadcg aadcg closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
@Ambrevar Ambrevar reopened this Jun 1, 2023
@Ambrevar
Copy link
Member

Ambrevar commented Jun 1, 2023

I think there might be a genuine bug here! :)

@aadcg aadcg closed this as completed Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug history Related to history handling.
Development

No branches or pull requests

4 participants