Events are not cached yet. But yeah this would be a good thing to keep in mind when we do

Reply to this note

Please Login to reply.

Discussion

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.