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
Can't delete system messages #1049
Comments
Hi @pushcx I do agree with using setting records with If possible more details about the bug could help me develop a more concrete solution. |
What details would be useful to you? After I figured out what caused the exception I wrote this up to give as much context as possible, so I don't know what more would help or I would've already included it. :) |
Pardon my dust @pushcx my thought process ran wild and it was late when I was responding. Using the null option definitely works. You could give that a try to see where it goes. |
I'm on it :) |
One of these tests is failing right now, this is subject of issue lobsters#1049 and will be fixed in the next commits.
I created PR #1078 |
When a Story is edited by user suggestions, the submitter gets a Message. That Message gets an
author_user_id
of0
and appears in the inbox as being from System rather than a named user.Since 12644b2 (and triggered by a user for the first time last month after >3y!) a bug prevents deleting these Messages, individually or batch-delete. When a recipient deletes a message it toggles the
deleted_by_recipient
boolean and saves, whereupon a callback (arrrgggggh) checks to see if the record should be deleted from the database. But instead an exception is thrown by.save!
because the object is invalid without a realauthor_user_id
.This needs a fix so users can delete system messages. Maybe the right fix is to make
author_user_id
nullable and migrate to replace the0
s withNULL
s? Or maybeMessagesController#destroy
and#batch_delete
should just directly delete records when possible and delete thecheck_for_both_deleted
magic entirely?The text was updated successfully, but these errors were encountered: