fix(discord): prevent stuck typing indicator
This commit is contained in:
committed by
Nimrod Gutman
parent
fb76e316fb
commit
a0fa283839
@@ -723,12 +723,18 @@ export async function processDiscordMessage(ctx: DiscordMessagePreflightContext)
|
||||
dispatchError = true;
|
||||
throw err;
|
||||
} finally {
|
||||
// Must stop() first to flush debounced content before clear() wipes state
|
||||
await draftStream?.stop();
|
||||
if (!finalizedViaPreviewMessage) {
|
||||
await draftStream?.clear();
|
||||
try {
|
||||
// Must stop() first to flush debounced content before clear() wipes state.
|
||||
await draftStream?.stop();
|
||||
if (!finalizedViaPreviewMessage) {
|
||||
await draftStream?.clear();
|
||||
}
|
||||
} catch (err) {
|
||||
// Draft cleanup should never keep typing alive.
|
||||
logVerbose(`discord: draft cleanup failed: ${String(err)}`);
|
||||
} finally {
|
||||
markDispatchIdle();
|
||||
}
|
||||
markDispatchIdle();
|
||||
if (statusReactionsEnabled) {
|
||||
if (dispatchError) {
|
||||
await statusReactions.setError();
|
||||
|
||||
Reference in New Issue
Block a user