From 746c8240206107dfc40f0995d17cd24730d40b0d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 23 Sep 2025 22:24:58 +0200 Subject: [PATCH] Fix Debug Logging toggle not working Closes #3268 --- src/plugins/_core/noTrack.ts | 9 +++++++++ src/utils/types.ts | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/_core/noTrack.ts b/src/plugins/_core/noTrack.ts index ad1f255b..eada58cb 100644 --- a/src/plugins/_core/noTrack.ts +++ b/src/plugins/_core/noTrack.ts @@ -71,6 +71,15 @@ export default definePlugin({ } ], + // The TRACK event takes an optional `resolve` property that is called when the tracking event was submitted to the server. + // A few spots in Discord await this callback before continuing (most notably the Voice Debug Logging toggle). + // Since we NOOP the AnalyticsActionHandlers module, there is no handler for the TRACK event, so we have to handle it ourselves + flux: { + TRACK(event) { + event?.resolve?.(); + } + }, + startAt: StartAt.Init, start() { // Sentry is initialized in its own WebpackInstance. diff --git a/src/utils/types.ts b/src/utils/types.ts index 2f1d6396..2293b2ff 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -26,6 +26,7 @@ import { MessageClickListener, MessageEditListener, MessageSendListener } from " import { MessagePopoverButtonFactory } from "@api/MessagePopover"; import { Command, FluxEvents } from "@vencord/discord-types"; import { ReactNode } from "react"; +import { LiteralUnion } from "type-fest"; // exists to export default definePlugin({...}) export default function definePlugin

(p: P & Record) { @@ -151,7 +152,7 @@ export interface PluginDef { * Allows you to subscribe to Flux events */ flux?: { - [E in FluxEvents]?: (event: any) => void | Promise; + [E in LiteralUnion]?: (event: any) => void | Promise; }; /** * Allows you to manipulate context menus