Nameless icon indicating copy to clipboard operation
Nameless copied to clipboard

Forum Last Post by a Deleted User Error

Open AutismFather opened this issue 1 year ago • 3 comments

Describe the issue

I deleted a user from the panel and now one of my forums is broken because the last post made in one of the threads was by that user. Now the forum returns an error because it's trying to grab their avatar and display name but the user no longer exists.

NamelessMC Version

2.1.0

To Reproduce

  1. Create a forum and a thread.
  2. Have a user create a post and be the last post in that thread.
  3. Delete user.
  4. Visit that forum.

Expected Behaviour

It should just no longer have any posts available by that deleted user, so there's no need to try to retrieve their data.

Screenshots

namelessmc_error

Additional Information

No response

AutismFather avatar Aug 02 '23 00:08 AutismFather

The issue here is that the DeleteUserForumHook did not trigger when the user was deleted to remove their forum content - this is strange because I'm not able to reproduce the issue locally on the latest development code.

I'm not sure this is worth handling within the forum module because the hook should be triggering correctly. I can't say I know why the hook didn't trigger but I will have a think as to what might have happened.

samerton avatar Aug 02 '23 19:08 samerton

Could maybe have a queue task which runs nightly to clear out any bad data such as this, but it'd mean there's potentially several hours when this type of error could occur

samerton avatar Aug 02 '23 19:08 samerton

Skjermbilde 2023-08-02 224529 Skjermbilde 2023-08-02 224600

Just to have it logged for this cause ^^ With happens if user is deleted

  • Websites made after pr13 deletes all rows from user automaticly, due of the table rules thing
  • Older websites requires hook to be successfull to delete the rows with is not triggered if module is disabled or if another module listener break before forum listener is run

partydragen avatar Aug 02 '23 20:08 partydragen