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

Bastion is slacking off??? #454

Closed
Capt-Blitz opened this issue Apr 29, 2024 · 10 comments
Closed

Bastion is slacking off??? #454

Capt-Blitz opened this issue Apr 29, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@Capt-Blitz
Copy link

Hey...I don't know exectly what is happening but on the GoldenNovaYugioh discord server we have noticed a trend of Bastion just refusing to acknowledge serch queries.
We don't know whats happening, can one of you look at it?

@kevinlul
Copy link
Contributor

Do you have a server ID?

image

@kevinlul kevinlul added the question Further information is requested label Apr 29, 2024
@kevinlul
Copy link
Contributor

kevinlul commented Apr 29, 2024

Observed similar behaviour in a different server on April 23 and April 25. However, as far as I can tell, in those cases, the earlier attempts are not being sent from Discord to Bastion. I don't have evidence to rule out some bug in Discord.js event processing or the initial Bastion preprocessing.

async run(message: Message): Promise<void> {
if (shouldIgnore(message)) {
return;
}
// Deactivate new functionality in select servers
// Always active in direct messages, threads, voice chats
if (
message.guildId &&
this.abdeploy.has(message.guildId) &&
!message.channel.isThread() &&
!message.channel.isVoiceBased()
) {
return;
}
if (!message.guildId && process.env.BOT_NO_DIRECT_MESSAGE_SEARCH) {
return;
}
if (!this.eventLocks.has(message.id, this.type)) {
return;
}
const delimiter = getDelimiter(message);
let inputs = preprocess(message.content, delimiter);
if (inputs.length === 0) {
return;
}

https://discord.com/developers/docs/reference#consistency

@Capt-Blitz
Copy link
Author

I don't see a server ID option, but here is the invite link
https://discord.gg/UPD9dcxu

@kevinlul
Copy link
Contributor

kevinlul commented May 1, 2024

Per https://discord.com/api/v8/invites/UPD9dcxu?with_counts=true, the server ID is 745060455327858819. Checking recent logs.

@kevinlul
Copy link
Contributor

kevinlul commented May 1, 2024

From the past week, the only thing I've spotted is two searches within a second for "share the pain" today by different users.

@kevinlul
Copy link
Contributor

kevinlul commented May 9, 2024

Approved to log channel 751160897032028361 in the same way as below

if (message.channelId === process.env.LOG_ALL_MESSAGE_CHANNEL) {
this.#logger.verbose(
JSON.stringify({
...(message.toJSON() as object),
channel: message.channel.toJSON()
})
);
}

@kevinlul
Copy link
Contributor

Logging is active now. Please let us know if you spot any misses effective from May 10 at 3:47 am ET.

@kevinlul
Copy link
Contributor

Four months ago in #434, a change was introduced that synchronized the ignore condition between the message ping and message search listeners. This added a new condition to ignore replies for message search. This behaviour is incorrect, unintuitive, and undocumented as all replies are ignored, not just direct replies to Bastion, and there are no merits of ignoring even those for message search. This should account for the majority of cases of this "heisenbug", though there still remain uncommon cases of Discord not sending the message to Bastion.

kevinlul added a commit that referenced this issue Jul 28, 2024
Four months ago in #434 (1e12130), a change was introduced that synchronized the ignore condition between the message ping and message search listeners. This added a new condition to ignore replies for message search. This behaviour is incorrect, unintuitive, and undocumented as all replies are ignored, not just direct replies, and there are no merits of ignoring even those for message search.
This should fix most cases reported in #454, though there still remain uncommon cases of Discord not sending the message event.
This also updates the logic in PingMessageListener so it can safely handle replies to other users containing a mention while ignoring reply mentions.
kevinlul added a commit that referenced this issue Jul 28, 2024
Four months ago in #434 (1e12130), a change was introduced that synchronized the ignore condition between the message ping and message search listeners. This added a new condition to ignore replies for message search. This behaviour is incorrect, unintuitive, and undocumented as all replies are ignored, not just direct replies, and there are no merits of ignoring even those for message search.
This should fix most cases reported in #454, though there still remain uncommon cases of Discord not sending the message event.
This also updates the logic in PingMessageListener so it can safely handle replies to other users containing a mention while ignoring reply mentions.
@kevinlul
Copy link
Contributor

@Capt-Blitz A fix was deployed. Please let me know if this restores your search experience or if you have any other feedback.

@kevinlul
Copy link
Contributor

The team reached out on Discord to the opener and confirmed the fix. There is still a follow-up idea to add a context menu command to resend to Bastion, but the reply fix covers most situations.

@kevinlul kevinlul added bug Something isn't working and removed question Further information is requested labels Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants