chore: properly handle bulk deletion in message view#1032
chore: properly handle bulk deletion in message view#1032amycatgirl wants to merge 1 commit intostoatchat:mainfrom
Conversation
Signed-off-by: Amy <amy+git@amogus.cloud>
| const c = client(); | ||
| c.addListener("messageCreate", onMessage); | ||
| c.addListener("messageDelete", onMessageDelete); | ||
| c.addListener("messageDeleteBulk", onMessageDeleteBulk); |
There was a problem hiding this comment.
Am I missing something here? Does this ever get called?
There was a problem hiding this comment.
It does, but only when the element is first mounted. The onMessageDeleteBulk function is only called when a bulk deletion event is received by the client. The listener is also removed when the element is unmounted.
It worked on my (very limited) testing, used Automod to bulk delete 10 messages and could confirm that the message elements did not persist.
|
I wonder if this also solves the issue of messages deleted by the Bolt bot not actually disappearing on the Stoat end until refresh... But I would assume that's a regular delete API call and not a bulk delete one? Also, don't forget to drop the i18n files from this one now that we have that workflow fixed. |
|
i forgor 💀 |
28ca790 to
3af0604
Compare
|
I would need to check what the bolt bot does when it deletes messages to see if this is the same issue. |
|
Looks like that's the case with bolt: https://codeberg.org/jersey/lightning/src/commit/6a1e2a2b815f20842fa6ba78c9a56882d33298bb/pkg/platforms/stoat/plugin.go#L177-L184 |
No description provided.