mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
fix(panel): prevent stale telemetry polls from reverting saved settings and avoid blocking forced reload
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
cloudSyncState,
|
||||
computeRuntimeCodeVersion,
|
||||
createDefaultSettingsObject,
|
||||
inFlightRequests,
|
||||
isPlainObject,
|
||||
loadSettings,
|
||||
lsRuntimeEndpoint,
|
||||
@@ -294,6 +295,7 @@ export function executeSettingsAction(data) {
|
||||
body: JSON.stringify({ ok: false, error: 'Failed to persist settings' }),
|
||||
};
|
||||
}
|
||||
inFlightRequests.clear();
|
||||
const prevMountMode = normalizeWindowMountMode(
|
||||
current.windowMountMode,
|
||||
current.enableWindowOverlay
|
||||
@@ -361,6 +363,7 @@ export async function executeModelContextWindowAction(data) {
|
||||
if (!saveJson(SETTINGS_FILE, current)) {
|
||||
return respond(500, { error: 'Failed to persist model context window' });
|
||||
}
|
||||
inFlightRequests.clear();
|
||||
void notifyModelContextWindowsChanged();
|
||||
return respond(200, { modelContextWindows: current.modelContextWindows });
|
||||
}
|
||||
@@ -377,6 +380,7 @@ export function executeResetSettingsAction() {
|
||||
body: JSON.stringify({ ok: false, error: 'Failed to reset settings' }),
|
||||
};
|
||||
}
|
||||
inFlightRequests.clear();
|
||||
const prevMountMode = normalizeWindowMountMode(
|
||||
current.windowMountMode,
|
||||
current.enableWindowOverlay
|
||||
|
||||
@@ -1718,7 +1718,7 @@ export async function buildTelemetryPayloadInternal(
|
||||
hostPlatform: process.platform || 'unknown',
|
||||
uiBundleVersion,
|
||||
windowBridge: getDefaultWindowBridgeStatus(),
|
||||
settings,
|
||||
settings: loadSettings(),
|
||||
contextWindowModels: getContextWindowGroups(getContextWindowModels(clientConfigs, contextModelCatalog)).map((group) => {
|
||||
const latest = group.members.reduce((previous, id) => {
|
||||
const reported = reportedContextLimits.get(id);
|
||||
|
||||
Reference in New Issue
Block a user