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

🐛 Unwanted Auto-Threads #432

Open
gracegloom101 opened this issue May 22, 2023 · 5 comments
Open

🐛 Unwanted Auto-Threads #432

gracegloom101 opened this issue May 22, 2023 · 5 comments
Labels
confirmed bug 🦋 Something isn't working

Comments

@gracegloom101
Copy link

Describe the bug

Out of nowhere, Needle will auto create threads for messages that existed before it was invited to the server, like messages that happened weeks before it was invited, just out of the blue!

Steps to reproduce the bug

I have no clue how to reproduce the bug, it comes at random to me but it's only happened once in each server I have it in

Expected behavior

Create new threads for old messages of when it wasn't in the server.

@gracegloom101 gracegloom101 added the potential bug 🐛 Has not been replicated yet label May 22, 2023
@MarcusOtter MarcusOtter added confirmed bug 🦋 Something isn't working and removed potential bug 🐛 Has not been replicated yet labels May 23, 2023
@MarcusOtter
Copy link
Owner

MarcusOtter commented May 23, 2023

Thanks for filing an issue for this, it's been discussed a bit in the Discord but I forgot to put it here.

The issue stems from Needle's startup script. When Needle has been offline and comes online again (which happens less than once every week) and finds a channel with auto-threading enabled where the latest message is missing a thread (but it should have one), it will create a thread on it and try to do it on the previous 10 messages in the channel as well (if they should have threads too).

Long story short: Needle will try to catch up to any threads it missed when it was offline. However, it does not take the timestamp into account (e.g. if it was offline for 5 seconds it could still create threads on messages that was weeks back, if they for some reason do not have a thread).

To work around this issue, make sure the latest message in an auto-thread channel has a thread. Then this will not happen.

Regardless - it is a bug that we should fix. We should track when Needle goes offline and it should check this timer when it comes online again to make sure it doesn't go back too far.

@MarcusOtter MarcusOtter changed the title Unwanted Auto-Threads🐛 🐛 Unwanted Auto-Threads May 23, 2023
@auwsom
Copy link

auwsom commented May 24, 2023

@MarcusOtter I noticed in this file there is code that checks for a flag option to disable the creation of missing threads.
src/eventListeners/ready.ts

        if (process.argv.includes("--skip-catch-up")) {
            console.log("Ready!");
            return;
        }

        try {
            await this.createMissingThreads(client);

@MarcusOtter
Copy link
Owner

Yes, that exists, but I want it to be enabled because when Needle is offline it should make sure that threads are caught up. But I have the flag just in case Needle has been down for hours or even days, then catching up is a bit spammy and difficult

@auwsom
Copy link

auwsom commented May 25, 2023 via email

@MarcusOtter
Copy link
Owner

We won't make that configurable as it is a bug - Needle should never do what you described and what this issue describes. There's a bug in this feautre because it does not take actual downtime into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug 🦋 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants