chore(lint): promise/always-return in app

This commit is contained in:
Mohamed Boudra
2026-04-24 03:40:11 +07:00
parent b12f48abc7
commit 413ef0258b
26 changed files with 55 additions and 0 deletions

View File

@@ -592,6 +592,7 @@ export async function installTerminalKeystrokeStressProbe(page: Page): Promise<v
text: frameText(bytes),
bytes: bytes.byteLength - 2,
});
return;
});
void eventDataText(event.data).then((text) => {
if (text === null) {
@@ -602,6 +603,7 @@ export async function installTerminalKeystrokeStressProbe(page: Page): Promise<v
bytes: new TextEncoder().encode(text).byteLength,
kind: textMessageKind(text),
});
return;
});
});
}

View File

@@ -191,6 +191,7 @@ function PushNotificationRouter() {
return;
}
removeDesktopNotificationListener = unlisten;
return;
});
}
@@ -240,6 +241,7 @@ function PushNotificationRouter() {
if (response) {
openFromResponse(response);
}
return;
});
return () => {
@@ -681,6 +683,7 @@ function OfferLinkListener({
const serverId = (profile as any)?.serverId;
if (typeof serverId !== "string" || !serverId) return;
router.replace(buildHostRootRoute(serverId));
return;
})
.catch((error) => {
if (cancelled) return;
@@ -752,6 +755,7 @@ function OpenProjectListener() {
if (!disposed && pending) {
maybeOpenProject(pending);
}
return;
})
.catch(() => undefined);
@@ -769,6 +773,7 @@ function OpenProjectListener() {
return;
}
unlisten = dispose;
return;
})
.catch(() => undefined);

View File

@@ -112,6 +112,7 @@ function HostAgentReadyRouteContent() {
return;
}
router.replace(buildHostRootRoute(serverId));
return;
})
.catch(() => {
if (cancelled || redirectedRef.current) {

View File

@@ -328,6 +328,7 @@ export function FileExplorerPane({
}
}
}
return;
});
}, [hasWorkspaceScope, requestDirectoryListing, workspaceStateKey]);

View File

@@ -895,6 +895,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
if (value === "pr" || value === "merge") {
setShipDefault(value);
}
return;
})
.catch(() => undefined);
return () => {
@@ -1093,6 +1094,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
void runCommit({ serverId, cwd })
.then(() => {
toastActionSuccess("Committed");
return;
})
.catch((err) => {
toastActionError(err, "Failed to commit");
@@ -1103,6 +1105,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
void runPull({ serverId, cwd })
.then(() => {
toastActionSuccess("Pulled");
return;
})
.catch((err) => {
toastActionError(err, "Failed to pull");
@@ -1113,6 +1116,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
void runPush({ serverId, cwd })
.then(() => {
toastActionSuccess("Pushed");
return;
})
.catch((err) => {
toastActionError(err, "Failed to push");
@@ -1124,6 +1128,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
void runCreatePr({ serverId, cwd })
.then(() => {
toastActionSuccess("PR created");
return;
})
.catch((err) => {
toastActionError(err, "Failed to create PR");
@@ -1140,6 +1145,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
.then(() => {
setPostShipArchiveSuggested(true);
toastActionSuccess("Merged");
return;
})
.catch((err) => {
toastActionError(err, "Failed to merge");
@@ -1163,6 +1169,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
void runMergeFromBase({ serverId, cwd, baseRef })
.then(() => {
toastActionSuccess("Updated");
return;
})
.catch((err) => {
toastActionError(err, "Failed to merge from base");
@@ -1179,6 +1186,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
void runArchiveWorktree({ serverId, cwd, worktreePath })
.then(() => {
router.replace(buildNewAgentRoute(serverId, targetWorkingDir));
return;
})
.catch((err) => {
toastActionError(err, "Failed to archive worktree");

View File

@@ -715,6 +715,7 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
return;
}
onAddImages(attachments);
return;
})
.catch((error) => {
console.error("[MessageInput] Failed to process pasted images:", error);

View File

@@ -1908,6 +1908,7 @@ function ProjectBlock({
toast.error("Failed to remove some workspaces");
}
setIsRemovingProject(false);
return;
});
})();
}, [isRemovingProject, serverId, displayName, toast, project.workspaces]);

View File

@@ -452,6 +452,7 @@ export function ContextMenuContent({
...rect,
y: rect.y + statusBarHeight,
});
return;
});
return () => {

View File

@@ -379,6 +379,7 @@ export function DropdownMenuContent({
...rect,
y: rect.y + statusBarHeight,
});
return;
});
return () => {

View File

@@ -450,6 +450,7 @@ export function TooltipContent({
measureElement(ctx.triggerRef.current).then((rect) => {
if (cancelled) return;
setTriggerRect({ ...rect, y: rect.y + statusBarHeight });
return;
});
return () => {

View File

@@ -221,6 +221,7 @@ function WorkspaceHoverCardContent({
measureElement(triggerRef.current).then((rect) => {
if (cancelled) return;
setTriggerRect(rect);
return;
});
return () => {

View File

@@ -118,6 +118,7 @@ export function SidebarCalloutProvider({ children }: { children: ReactNode }) {
const nextKeys = parseDismissedCalloutKeys(value);
dismissedKeysRef.current = nextKeys;
setDismissedKeys(nextKeys);
return;
})
.catch((error) => {
console.error("[SidebarCallouts] Failed to load dismissed callouts", error);

View File

@@ -82,6 +82,7 @@ export function LocalDaemonSection() {
daemonStatus?.status === "running" ? "Daemon restarted." : "Daemon started.",
);
refetch();
return;
})
.catch((error) => {
console.error("[Settings] Failed to change desktop daemon state", error);
@@ -91,6 +92,7 @@ export function LocalDaemonSection() {
.finally(() => {
setIsRestartingDaemon(false);
});
return;
})
.catch((error) => {
console.error("[Settings] Failed to open desktop daemon action confirmation", error);
@@ -116,6 +118,7 @@ export function LocalDaemonSection() {
void updateSettings({ manageBuiltInDaemon: true })
.then(() => {
setStatusMessage("Built-in daemon management resumed.");
return;
})
.catch((error) => {
console.error("[Settings] Failed to update built-in daemon management", error);
@@ -158,6 +161,7 @@ export function LocalDaemonSection() {
.then(() => {
refetch();
setStatusMessage("Built-in daemon paused and stopped.");
return;
})
.catch((error) => {
console.error("[Settings] Failed to pause built-in daemon management", error);
@@ -166,6 +170,7 @@ export function LocalDaemonSection() {
.finally(() => {
setIsUpdatingDaemonManagement(false);
});
return;
})
.catch((error) => {
console.error("[Settings] Failed to open built-in daemon pause confirmation", error);
@@ -189,6 +194,7 @@ export function LocalDaemonSection() {
void Clipboard.setStringAsync(logPath)
.then(() => {
Alert.alert("Copied", "Log path copied.");
return;
})
.catch((error) => {
console.error("[Settings] Failed to copy log path", error);
@@ -224,6 +230,7 @@ export function LocalDaemonSection() {
void Clipboard.setStringAsync(cliStatusOutput)
.then(() => {
Alert.alert("Copied", "Status copied to clipboard.");
return;
})
.catch((error) => {
console.error("[Settings] Failed to copy daemon status", error);

View File

@@ -117,6 +117,7 @@ export function createDesktopLocalDaemonTransportFactory(): DaemonTransportFacto
return;
}
unlisten = cleanup;
return;
})
.catch((error) => {
emitError(error);
@@ -130,6 +131,7 @@ export function createDesktopLocalDaemonTransportFactory(): DaemonTransportFacto
}
sessionId = id;
emitOpen();
return;
})
.catch((error) => {
emitError(error);

View File

@@ -145,6 +145,7 @@ export function useCheckoutDiffQuery({
error: payload.error,
requestId: payload.requestId,
});
return;
})
.catch((error) => {
if (cancelled) {

View File

@@ -167,6 +167,7 @@ export function useFileDropZone({
return;
}
onFilesDroppedRef.current(attachments);
return;
})
.catch((error) => {
console.error("[useFileDropZone] Failed to persist dropped files:", error);

View File

@@ -75,6 +75,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
if (value === "pr" || value === "merge") {
setShipDefault(value);
}
return;
})
.catch(() => undefined);
return () => {
@@ -150,6 +151,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
void runCommit({ serverId, cwd })
.then(() => {
toastActionSuccess("Committed");
return;
})
.catch((err) => {
toastActionError(err, "Failed to commit");
@@ -160,6 +162,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
void runPull({ serverId, cwd })
.then(() => {
toastActionSuccess("Pulled");
return;
})
.catch((err) => {
toastActionError(err, "Failed to pull");
@@ -170,6 +173,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
void runPush({ serverId, cwd })
.then(() => {
toastActionSuccess("Pushed");
return;
})
.catch((err) => {
toastActionError(err, "Failed to push");
@@ -181,6 +185,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
void runCreatePr({ serverId, cwd })
.then(() => {
toastActionSuccess("PR created");
return;
})
.catch((err) => {
toastActionError(err, "Failed to create PR");
@@ -197,6 +202,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
.then(() => {
setPostShipArchiveSuggested(true);
toastActionSuccess("Merged");
return;
})
.catch((err) => {
toastActionError(err, "Failed to merge");
@@ -220,6 +226,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
void runMergeFromBase({ serverId, cwd, baseRef })
.then(() => {
toastActionSuccess("Updated");
return;
})
.catch((err) => {
toastActionError(err, "Failed to merge from base");
@@ -236,6 +243,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
void runArchiveWorktree({ serverId, cwd, worktreePath })
.then(() => {
router.replace(buildNewAgentRoute(serverId, targetWorkingDir));
return;
})
.catch((err) => {
toastActionError(err, "Failed to archive worktree");

View File

@@ -388,6 +388,7 @@ function AgentPanelBody({
storeFetchedAgentDetail({ serverId, result });
setLookupState({ tag: "idle" });
return;
})
.catch((error) => {
if (attemptToken !== lookupAttemptTokenRef.current) {
@@ -834,6 +835,7 @@ function ChatAgentContent({
return;
}
setMissingAgentState({ kind: "idle" });
return;
})
.catch((error) => {
if (attemptToken !== initAttemptTokenRef.current) {

View File

@@ -125,6 +125,7 @@ function SetupPanel() {
payload: { workspaceId: response.workspaceId, ...response.snapshot },
});
}
return;
})
.catch(() => {
// Server may not support this yet — ignore

View File

@@ -397,6 +397,7 @@ function DesktopAppUpdateRow() {
return;
}
void installUpdate();
return;
})
.catch((error) => {
console.error("[Settings] Failed to open app update confirmation", error);

View File

@@ -563,6 +563,7 @@ function RestartDaemonCard({ host }: { host: HostProfile }) {
);
});
void waitForDaemonRestart();
return;
})
.catch((error) => {
console.error(`[HostPage] Failed to open restart confirmation for ${host.label}`, error);
@@ -687,6 +688,7 @@ function RemoveHostSection({ host, onRemoved }: { host: HostProfile; onRemoved?:
.then(() => {
setIsConfirming(false);
onRemoved?.();
return;
})
.catch((error) => {
console.error("[HostPage] Failed to remove host", error);

View File

@@ -208,6 +208,7 @@ export function StartupSplashScreen({ bootstrapState }: StartupSplashScreenProps
return;
}
setDaemonLogs(logs);
return;
})
.catch((error) => {
if (isCancelled) {

View File

@@ -1281,6 +1281,7 @@ function WorkspaceScreenContent({
serverId: normalizedServerId,
payload: { workspaceId: response.workspaceId, ...response.snapshot },
});
return;
})
.catch(() => {
if (requestedWorkspaceSetupStatusKeyRef.current === persistenceKey) {

View File

@@ -303,6 +303,7 @@ export class TerminalEmulatorRuntime {
if (text) {
terminal.paste(text);
}
return;
});
return false;
}
@@ -393,6 +394,7 @@ export class TerminalEmulatorRuntime {
void fontSet?.ready
.then(() => {
fitAndEmitResize(true);
return;
})
.catch(() => {
// no-op

View File

@@ -107,6 +107,7 @@ export class TerminalStreamController {
isAttaching: false,
error: null,
});
return;
})
.catch((error: unknown) => {
if (this.disposed || this.terminalId !== nextTerminalId) {

View File

@@ -135,6 +135,7 @@ export function connectAndProbe(
serverId: serverInfo.serverId,
hostname: serverInfo.hostname,
});
return;
})
.catch((error) => {
clearTimeout(timer);