flarum / issue-archive

0 stars 0 forks source link

[Approval] Flag is deleted when dismissing the delete post prompt #114

Open matteocontrini opened 3 years ago

matteocontrini commented 3 years ago

Bug Report

Current Behavior

When you have an unapproved post and you click "delete" and then "Cancel" in the prompt, the flag is deleted anyway even if the action was cancelled.

https://user-images.githubusercontent.com/2164763/113631397-b3f76700-9669-11eb-9624-4b2bb00f4b5d.mp4

Steps to Reproduce

  1. Make sure to have a user that cannot post without approval
  2. Create a new post/discussion with that user
  3. Login as an admin
  4. Click "Delete" and then "Cancel" in the browser prompt
  5. The flag is deleted

Expected Behavior

The flag should stay there.

Environment

askvortsov1 commented 3 years ago

Issue seems to come from https://github.com/flarum/flags/blob/master/js/src/forum/addFlagsToPosts.js#L57-L63. The goal is dismissing a flag on post soft delete, but I'm not 100% sure that's the proper action: we'd want to mark that action was taken, otherwise https://github.com/flarum/flags/pull/21 becomes a lot less useful.

davwheat commented 3 years ago

It looks like this issue also happens when not using approval too.