Skip to content

chore: properly handle bulk deletion in message view#1032

Open
amycatgirl wants to merge 1 commit intostoatchat:mainfrom
amycatgirl:chore/properly-handle-bulk-deletion
Open

chore: properly handle bulk deletion in message view#1032
amycatgirl wants to merge 1 commit intostoatchat:mainfrom
amycatgirl:chore/properly-handle-bulk-deletion

Conversation

@amycatgirl
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Amy <amy+git@amogus.cloud>
@amycatgirl amycatgirl requested a review from a team as a code owner March 16, 2026 01:36
@ThomasJRyan ThomasJRyan requested a review from a team March 16, 2026 03:16
const c = client();
c.addListener("messageCreate", onMessage);
c.addListener("messageDelete", onMessageDelete);
c.addListener("messageDeleteBulk", onMessageDeleteBulk);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something here? Does this ever get called?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Pecacheu
Copy link
Copy Markdown
Contributor

Pecacheu commented Mar 24, 2026

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.

@amycatgirl
Copy link
Copy Markdown
Contributor Author

i forgor 💀

@amycatgirl amycatgirl force-pushed the chore/properly-handle-bulk-deletion branch from 28ca790 to 3af0604 Compare March 24, 2026 14:22
@amycatgirl
Copy link
Copy Markdown
Contributor Author

I would need to check what the bolt bot does when it deletes messages to see if this is the same issue.

@amycatgirl
Copy link
Copy Markdown
Contributor Author

Looks like that's the case with bolt: https://codeberg.org/jersey/lightning/src/commit/6a1e2a2b815f20842fa6ba78c9a56882d33298bb/pkg/platforms/stoat/plugin.go#L177-L184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants