Skip to content
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

Deleting note in hidden column throws error #4087

Open
mateo-ivc opened this issue Apr 18, 2024 · 1 comment
Open

Deleting note in hidden column throws error #4087

mateo-ivc opened this issue Apr 18, 2024 · 1 comment
Assignees
Labels
Refinement Required Need to be refined

Comments

@mateo-ivc
Copy link
Collaborator

mateo-ivc commented Apr 18, 2024

The problem

When the owner or a moderator deletes a note in a hidden column, all normal user get an error printed with the cause:
'Cannot read properties of undefined (reading 'position')'

Browser

Chromium, Firefox

Steps to reproduce the behavior

  1. Join with normal user on a board
  2. Create note in hidden column
  3. Delete note again

Result:
There should be an error in the console of the normal participant

Screenshots

image

Additional context

deletedNote in line 74 of store/reducer/note.ts seems to be undefined

@mateo-ivc
Copy link
Collaborator Author

mateo-ivc commented Apr 18, 2024

deletedNote is declared as this:
const deletedNote = state.find((n) => n.id === action.noteId);

But state only stores notes that are visible for the client. Which leads to deletedNote to be undefined when deleting a hidden note

Possible Solution:

  • Don't send BoardEventNoteDeleted when the deleted not is not visible for the user

@mateo-ivc mateo-ivc self-assigned this May 6, 2024
@SelinaBuff SelinaBuff added the Refinement Required Need to be refined label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refinement Required Need to be refined
Projects
None yet
Development

No branches or pull requests

2 participants