Kris_88 wrote: ↑2022-10-27, 22:15
Why not just intercept "places-connection-closed" notification and then make your things?
It doesn't work!
I uninstalled the "Backup Bookmarks on Palemoon Close" add-on and then used the code you provided. It worked until I restarted Windows and deleted the Pale Moon Cache, then it didn't work anymore: Pale Moon restarted to close with the error message "Pale Moon web browser has stopped working" and your code didn't backup the "places.sqlite" file anymore.
Important!
When Pale Moon closes with this error message, the "places.sqlite-shm" and "places.sqlite-wal" files are no longer deleted, indicating that the database is no longer closed.
**********
Moonchild wrote: ↑2022-10-27, 19:57
The behaviour you're seeing is because you have corrupted your places database with the extension (a considerable risk I indicated).
As I said in a previous comment:
Moonchild wrote: ↑2022-05-23, 17:40
Pale Moon had the same problem ("Pale Moon web browser has stopped working") before making this add-on. From this I conclude that it is not this add-on that created the problem.
**********
Moonchild wrote: ↑2022-10-27, 19:57
Removing the sqlite database and letting the browser create a new one and then re-importing your bookmarks from html (or potentially a json bookmark backup) is probably the only way you can restore sanity at this point.
I tried the two options you suggested, after previously uninstalling the "Backup Bookmarks on Palemoon Close" add-on.
1. I started with "Export Bookmarks to HTML". It took about five minutes to complete this procedure. Pale Moon produced the 170 MB file "bookmarks.html":
01 Backup html.jpg
2. The next step was to make backup bookmarks in "json" format. This procedure failed. After about a minute, the procedure ended with no message and no result:
02 Backup json.jpg
03 Backup json.jpg
As you can see, the procedure ended without producing a "json" file.
I repeated this step three times (with the same result), then gave up.
3. Next I deleted the database, after which Pale Moon created a new one. After restarting the browser, I did "Import Bookmarks from HTML":
04 Import Bookmarks from HTML.png
05 Import Bookmarks from HTML.png
After more than ten minutes, during which time I received seven messages like the one in the picture above, Pale Moon created the following files:
• places.sqlite
• places.sqlite-shm
• places.sqlite-wal
The "places.sqlite" file was the same size (120 MB) as the one from which the "bookmarks.html" file was created, but a 116 MB "places.sqlite-wal" file was created:
06 Import Bookmarks from HTML.png
07 Import Bookmarks from HTML.png
From this point on Pale Moon started to close again with the error message "Pale Moon web browser has stopped working", so it didn't close the database anymore and the 116 MB file "places.sqlite-wal" remained intact. This seems to have caused another problem: every time I tried to "scroll" the bookmarks in Pale Moon, I had to wait a while until the bookmarks scrolling unblocked.
Moonchild wrote: ↑2022-10-27, 19:57
Manually shutting down the places database on window close may avoid this crash ... but that doesn't mean it actually fixes anything. Quite the opposite, it just avoids a symptom.
In the end, I'm back to avoiding the problem, not solving it, which doesn't seem to work if I don't give up using the old bookmarks. I went back to the old database (the old "places.sqlite") and to the " Backup Bookmarks on Palemoon Close" add-on. The scrolling problem disappeared as well as the error message when closing Pale Moon. As I said before, I don't want to resort to creating a new database, i.e. not having the old bookmarks loaded in Pale Moon, so as long as my add-on works, i.e. as long as Pale Moon closes without error and merges the "places.sqlite-shm" and "places.sqlite-wal" files into the main "places.sqlite" file, as long as I don't lose any bookmarks and as long as the "Places Database - Verify Integrity" test shows me that the database is OK (uncorrupted), for me it is less important that this solution "doesn't fixes anything, it just avoids a symptom".
You do not have the required permissions to view the files attached to this post.