How can I find notifications that I missed because the program that sent them crash?

0
89


Sometimes a program (say, Discord) crashes on me, and I lose a bunch of notifications that are painful to lose. I’m looking for a way to see what I missed.

What I’ve tried

A question from ten years ago, Does the OS X log notifications from the Notification Center? answer the question asked in the affirmative: notifications are logged. One of the more recent answers gives a recipe for finding the database of notifications, which I used successfully:

lsof -p $(ps aux | grep -m1 usernoted | awk '{ print $2 }')| awk '{ print $NF }' | grep 'db2/db$' | xargs dirname

This revealed a folder called db2 a couple levels within /private/var/folders. Strangely, the folder contained a link of some sort to itself. Undaunted, I copied the other files from the directory (db-shm, db-wal, and db) to a temporary directory. I tried opening each file with DB Browser for SQLite. db was the largest file, but I couldn’t figure out what table I should be looking at. They all had only a handful of rows, and some were clearly metadata. The other two files seemed too small to contain much, but the SQL Browser thinks they are encrypted (perhaps it interprets any gibberish it doesn’t understand as an encrypted file?). So I am left without a way to track down old notifications.