vicariousdrama / cornychat

🌽 Corny Chat is an open source audio space built on Jam that integrates Nostr and Lightning
https://cornychat.com
GNU Affero General Public License v3.0
21 stars 6 forks source link

Deleting Moderators/Speakers (and probably owners) causes error in client #11

Closed vicariousdrama closed 5 months ago

vicariousdrama commented 6 months ago

When deleting a moderator or speaker, the remove calls for each entry being deleted conflict with the main room update call on the back end with the new logic to prevent overwrites. The user is presented with an error indicating the settings couldnt be updated.

Both of these are calling the put function in ui/jam-core/backend.js which performs an authenticated api request to 'PUT' the data to the endpoint. The backend then bails as these subsequent calls aren't issuing the new updateTime value from the prior call.

This is initiated in ui/views/editRoom/EditRoom.jsx around line 100 for the owners, moderators and speakers. It may not be necessary to make these removeModerator and removeSpeaker calls unless they are issuing swarm updates. If so, it may be better to do the removeModerator and removeSpeaker call after the normal update?

vicariousdrama commented 6 months ago

The removeModerator and removeSpeaker dont do swarm, so any room updates are already being pushed. As such, this block of code may not be necessary. Putting in temporary wrap to not run it and its a candidate for future deletion.

vicariousdrama commented 5 months ago

These are no longer being removed before the update. Issue resolved