-
-
Notifications
You must be signed in to change notification settings - Fork 70
Assorted fixes for errors #1820
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested posts and reactions from deleted users. (I don't have any destroyed ones, so we should double-check this on the dev server.) LGTM.
be37144
to
a191df6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I recommend a second code-reviewer as a sanity check, particularly if you're going to handle those TODOs about new routes here rather than later.
redirect_to comment_thread_path(@comment_thread.id) | ||
end | ||
|
||
def archive_thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For other reviewers: the code in this block is copied from elsewhere, no changes to logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more precise, these mehtods are more or less extractions of individual cases of thread_restrict
and thread_unrestrict
actions. It's intended that they'll become proper actions in the future (cc @trichoplax given that you are working on thread followers - there'll now be follow_thread
and unfollow_thread
methods)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a note for other reviewers - I went ahead and split the thread_restrict
action, so archiving, deleting, locking, and following threads need to be tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested archive/restore, delete/undelete, lock/unlock, and follow/unfollow, all from the in-page tools menu. All of that worked fine.
I then repeated the tests on the thread page. For lock, archive, delete, and follow, the action worked but when the page was refreshed, it showed the "collapse" and "show thread" controls (from the in-page view), which don't make sense here:

Reloading the page removes them, so this is only an issue on the immediate response to the action, which I guess is assuming context from the in-page view? (I.e. the header with the Tools menu etc can't tell where it is, maybe?) Not a big deal but a bit weird -- can be deferred if this isn't a trivial fix.
Interestingly, this does not happen for unlock, restore, undelete, and unfollow. I looked for a difference in the controller (since these used to be rolled up into two methods, "restrict" and "unrestrict"), but I'm not spotting it if that's where it's coming from. The comment_thread
view isn't changed on this PR, but this behavior doesn't happen on the dev server as of 5c83ab90 (2025-09-05 19:17:57Z). That probably means it's in the Javascript, heaven help us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, that's likely just a side-effect of that we now replace the thread's content instead of reloading the whole page. It works as expected (this obviously doesn't happen for thread_unrestrict
actions as those retain the old behavior for now unless I end up splitting those too), I suspect we also have the same issue when expanding threads from inline view. Good catch, let's fix it while we are at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now, @cellio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working now, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruby code LGTM. JS code doesn't raise any alarms but we should have someone who understands JS better take a look at that part.
I tested the items listed in the PR description and everything that I'm able to test works fine, except for one minor weird rendering thing described in an earlier comment. It's ok with me if we file an issue to fix that later. (fixed) Also, as mentioned earlier, I don't have any destroyed users to experiment on; I don't see anything here that would make that worse, and it very likely fixes problems from that, so if we can't test it in dev, that shouldn't block us. I think we have some destroyed users on the dev server but am not certain.
Fixes 2 server errors (likely no longer possible due to us switching to soft deletions of users, but we still have to account for full deletion requests and issues caused by legacy behavior of hard-deleting users) and a couple of other, non-crashing errors:
locked_at
column despite being lockable (UnknownAttributeError
error);0
(FloatDomainError
error);I haven't checked if there are open issues because this is a followup for a chat discussion, but feel free to link them if you know of any.
Note for reviewers: this PR requires migrations to be run when checked out and rolled back when left to preserve your sanity. Don't forget to
rails db:migrate
->rails db:rollback
as needed.