Iāve been fighting with a bug on Nostream where deleted notes are still being sent out. Havenāt found what the issue is yet.
Discussion
Redis cache. This class of bug is almost always caching.
Events are not cached yet. But yeah this would be a good thing to keep in mind when we do
Obviously this is your project and I only spent 5 minutes looking at the code, but maybe this will be helpful? Feel free to ignore, Iām likely wrong.
`DBEvent` has a `deleted_at` field so I searched the codebase for `deleted_at` (https://github.com/search?q=repo%3ACameri%2Fnostream+deleted_at&type=code).
`EventRepository` sets `deleted_at` when marking an event as deleted via `deleteByPubkeyAndIds`.
But then looking at `findByFilters`, I donāt see anything explicitly adding a `AND WHERE deleted_at IS NULL` segment to the db query.
Iām sure Iām missing something but just throwing out what I see.
Thanks.
I have a PR open, but pushed code does not reflect my local staging where I have been trying to fix the bug.
I added a log statement and deleted_at was coming always as null.
I was planning on filtering events after fetching from the DB to not impact performance.
I will probably just delete the event from the DB and drop the deleted_at column since itās an anti pattern.
Oh man that was dumb of me š¬ should have checked the PRs.
Personally I think actually deleting the row instead of a deleted flag makes the most sense for this scenario.
As a user, if I delete an event, I hope my relays will respect that by purging the data (or at least the content). I probably deleted it because it contains info I donāt want out there anymore.