Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(web): handle floating promises in queries, clients, router and tooling (#8258)

teo14c54d997c0a
diff --git a/apps/web/scripts/git-check.ts b/apps/web/scripts/git-check.ts
index 07535461f9..7a8a54d549 100644
--- a/apps/web/scripts/git-check.ts
+++ b/apps/web/scripts/git-check.ts
@@ -95,4 +95,4 @@ async function main() {
return 0;
}
-main().then(process.exit);
+process.exit(await main());
diff --git a/apps/web/scripts/preview/get-or-create-id.ts b/apps/web/scripts/preview/get-or-create-id.ts
index 3e668167b5..b79a2dfc2d 100644
--- a/apps/web/scripts/preview/get-or-create-id.ts
+++ b/apps/web/scripts/preview/get-or-create-id.ts
@@ -127,5 +127,5 @@ async function main() {
}
if (import.meta.main) {
- main();
+ await main();
}
diff --git a/apps/web/scripts/preview/post-comment.ts b/apps/web/scripts/preview/post-comment.ts
index f1d2f73745..c68fd5131d 100644
--- a/apps/web/scripts/preview/post-comment.ts
+++ b/apps/web/scripts/preview/post-comment.ts
@@ -144,5 +144,5 @@ async function main() {
}
if (import.meta.main) {
- main();
+ await main();
}
diff --git a/apps/web/scripts/write-bundle-manifest.test.mjs b/apps/web/scripts/write-bundle-manifest.test.mjs
index ae18486e2b..64c890e15f 100644
--- a/apps/web/scripts/write-bundle-manifest.test.mjs
+++ b/apps/web/scripts/write-bundle-manifest.test.mjs
@@ -20,15 +20,15 @@ function build(env) {
}
}
-test('independent mobile minima use a schema older updaters reject', () => {
+await test('independent mobile minima use a schema older updaters reject', () => {
const manifest = build({ MIN_NATIVE_BUILD_ANDROID: '2050001', MIN_NATIVE_BUILD_IOS: '184' });
assert.equal(manifest.schemaVersion, 3);
assert.deepEqual(manifest.minNativeBuilds, { android: 2050001, ios: 184 });
});
-test('incomplete or unsafe minima fail the build', () => {
+await test('incomplete or unsafe minima fail the build', () => {
assert.throws(() => build({ MIN_NATIVE_BUILD_ANDROID: '2' }));
assert.throws(() => build({ MIN_NATIVE_BUILD_ANDROID: '9007199254740992', MIN_NATIVE_BUILD_IOS: '1' }));
});
-test('legacy manifests retain schema 2', () => {
+await test('legacy manifests retain schema 2', () => {
assert.equal(build({ MIN_NATIVE_BUILD: '5' }).schemaVersion, 2);
});
diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx
index 971d452fc6..d9cf729977 100644
--- a/apps/web/src/index.tsx
+++ b/apps/web/src/index.tsx
@@ -11,6 +11,7 @@ import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { getPlatform, isTauri } from '@core/util/platform';
import { platformFetch } from '@core/util/platformFetch';
import { promptReloadForFailedLoad } from '@core/util/reloadForNewerBuild';
+import { Telemetry } from '@macro-inc/observability';
import { initMonochromeIcons } from '@ui/utils/monochromeIcons';
import { ErrorBoundary, render } from 'solid-js/web';
import { FatalError } from './components/app/FatalError';
@@ -115,5 +116,4 @@ async function main() {
renderApp();
}
-// unawaited
-main();
+main().catch((error) => Telemetry.error(error, { surface: 'app-startup' }));
diff --git a/apps/web/src/lib/analytics/posthog.tsx b/apps/web/src/lib/analytics/posthog.tsx
index 3ea25b43c4..efc5892878 100644
--- a/apps/web/src/lib/analytics/posthog.tsx
+++ b/apps/web/src/lib/analytics/posthog.tsx
@@ -1,6 +1,7 @@
import { useAnalytics } from '@app/lib/analytics/analytics-context';
import type { RemoteFlag } from '@core/constant/featureFlags';
import { createAssertedContextProvider } from '@core/context/createContext';
+import { Telemetry } from '@macro-inc/observability';
import type { JsonType } from 'posthog-js';
import {
type Accessor,
@@ -48,7 +49,7 @@ export const [PosthogProvider, usePosthog] = createAssertedContextProvider(
}
setFlagsUnreachable(ctx?.errorsLoading === true);
setFlagsLoaded(true);
- });
+ }).catch((error) => Telemetry.error(error, { surface: 'feature-flags' }));
});
onCleanup(unsub);
diff --git a/apps/web/src/lib/graphql-cache/exchange/inspection.test.ts b/apps/web/src/lib/graphql-cache/exchange/inspection.test.ts
index a239ce1daa..3d62f6ae5e 100644
--- a/apps/web/src/lib/graphql-cache/exchange/inspection.test.ts
+++ b/apps/web/src/lib/graphql-cache/exchange/inspection.test.ts
@@ -107,7 +107,7 @@ describe('typed generated query inspection', () => {
variableFilters: [{ input: { initial: { limit: 20 } } }],
});
// @ts-expect-error Filters are typed from the generated operation variables.
- inspect(host, selected, { variableFilters: [{ missing: true }] });
+ await inspect(host, selected, { variableFilters: [{ missing: true }] });
expectTypeOf(
variants[0]!.variables
).toEqualTypeOf<GroupSoupMembershipQueryVariables>();
diff --git a/apps/web/src/lib/queries/agent-session/mention-batcher.ts b/apps/web/src/lib/queries/agent-session/mention-batcher.ts
index 057b3fa928..8e5591b61e 100644
--- a/apps/web/src/lib/queries/agent-session/mention-batcher.ts
+++ b/apps/web/src/lib/queries/agent-session/mention-batcher.ts
@@ -30,6 +30,6 @@ export function createAgentSessionMentionBatcher(
);
return (id: string) =>
new Promise<AgentSessionMentionPreview>((resolve, reject) => {
- batcher.addItem({ id, resolve, reject });
+ void batcher.addItem({ id, resolve, reject });
});
}
diff --git a/apps/web/src/lib/queries/auth/github-link.ts b/apps/web/src/lib/queries/auth/github-link.ts
index 8d7d3e341a..6431ebcc74 100644
--- a/apps/web/src/lib/queries/auth/github-link.ts
+++ b/apps/web/src/lib/queries/auth/github-link.ts
@@ -111,7 +111,7 @@ export function useDeleteGithubLinkMutation() {
mutationFn: async () =>
await throwOnErr(() => authServiceClient.deleteGithubLink()),
onSuccess: () => {
- invalidateGithubLinkStatus();
+ void invalidateGithubLinkStatus();
invalidateAllSoup();
},
}));
diff --git a/apps/web/src/lib/queries/bots/profiles.ts b/apps/web/src/lib/queries/bots/profiles.ts
index 141ce97cd4..30e444ad9f 100644
--- a/apps/web/src/lib/queries/bots/profiles.ts
+++ b/apps/web/src/lib/queries/bots/profiles.ts
@@ -70,7 +70,7 @@ class BotProfileLoader {
existing.push({ resolve, reject });
} else {
this.pendingRequests.set(botId, [{ resolve, reject }]);
- this.batcher.addItem(botId);
+ void this.batcher.addItem(botId);
}
});
}
diff --git a/apps/web/src/lib/queries/calendar/mention-preview.ts b/apps/web/src/lib/queries/calendar/mention-preview.ts
index 94bdb0473e..34f77e49e2 100644
--- a/apps/web/src/lib/queries/calendar/mention-preview.ts
+++ b/apps/web/src/lib/queries/calendar/mention-preview.ts
@@ -19,11 +19,11 @@ const MENTION_PREVIEW_STALE_TIME = 60_000;
*/
export function invalidateCalendarEventPreviews(eventId?: string): void {
if (eventId) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: previewKeys.item(eventId).queryKey,
});
} else {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: previewKeys._def,
// The key carries no type, so it can only be read from cached data.
// Entries without data need no sweep: null is a cached
@@ -37,10 +37,10 @@ export function invalidateCalendarEventPreviews(eventId?: string): void {
},
});
}
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: calendarKeys.searchPreviews._def,
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: eventId
? [...calendarKeys.mentionPreview._def, eventId]
: calendarKeys.mentionPreview._def,
diff --git a/apps/web/src/lib/queries/calendar/sync.ts b/apps/web/src/lib/queries/calendar/sync.ts
index f9a5492783..3e08d536bf 100644
--- a/apps/web/src/lib/queries/calendar/sync.ts
+++ b/apps/web/src/lib/queries/calendar/sync.ts
@@ -14,9 +14,9 @@ import { refreshTeamCalendarQueries } from './team-cache';
export function invalidateCalendarViews(): void {
void refreshTeamCalendarQueries();
void invalidateCalendarInvitations();
- invalidateCalendarOccurrences();
+ void invalidateCalendarOccurrences();
invalidateCalendarEventPreviews();
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: calendarKeys.visibleCalendars.queryKey,
});
}
@@ -55,10 +55,10 @@ export function handleRefreshCalendar(payload: unknown): void {
// only the caches without optimistic writes refresh meanwhile.
if (queryClient.isMutating({ mutationKey: RSVP_MUTATION_KEY }) === 0) {
void invalidateCalendarInvitations();
- invalidateCalendarOccurrences();
+ void invalidateCalendarOccurrences();
}
invalidateCalendarEventPreviews();
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: calendarKeys.visibleCalendars.queryKey,
});
}
diff --git a/apps/web/src/lib/queries/call/call.ts b/apps/web/src/lib/queries/call/call.ts
index 1fb35dd6e6..064a962393 100644
--- a/apps/web/src/lib/queries/call/call.ts
+++ b/apps/web/src/lib/queries/call/call.ts
@@ -120,7 +120,7 @@ function _useJoinCallMutation() {
mutationFn: async (channelId: string) =>
await throwOnErr(() => callServiceClient.getOrCreateCall(channelId)),
onSuccess() {
- invalidateActiveCallQueries();
+ void invalidateActiveCallQueries();
},
onError(error: Error) {
if (
@@ -160,7 +160,7 @@ export function useLeaveCallMutation() {
}
},
onSuccess() {
- invalidateActiveCallQueries();
+ void invalidateActiveCallQueries();
},
onError(error: Error) {
console.error('failed to leave call', error);
@@ -261,7 +261,9 @@ export function setCallRecordTeamShareCache(callId: string, shared: boolean) {
}
function invalidateCallRecord(callId: string) {
- queryClient.invalidateQueries({ queryKey: callKeys.record(callId).queryKey });
+ void queryClient.invalidateQueries({
+ queryKey: callKeys.record(callId).queryKey,
+ });
}
/**
diff --git a/apps/web/src/lib/queries/channel/activity.ts b/apps/web/src/lib/queries/channel/activity.ts
index 3effe0e7fb..2e4884ed3c 100644
--- a/apps/web/src/lib/queries/channel/activity.ts
+++ b/apps/web/src/lib/queries/channel/activity.ts
@@ -51,5 +51,7 @@ export function useUpdateChannelsActivityMutation(
}
export function invalidateChannelsActivity() {
- queryClient.invalidateQueries({ queryKey: channelKeys.activity.queryKey });
+ void queryClient.invalidateQueries({
+ queryKey: channelKeys.activity.queryKey,
+ });
}
diff --git a/apps/web/src/lib/queries/channel/channel-attachments.ts b/apps/web/src/lib/queries/channel/channel-attachments.ts
index 7ec28faf87..f0e734129d 100644
--- a/apps/web/src/lib/queries/channel/channel-attachments.ts
+++ b/apps/web/src/lib/queries/channel/channel-attachments.ts
@@ -110,7 +110,7 @@ export function getChannelAttachmentsQueryKeyPrefix(channelId: string) {
}
function _softInvalidateChannelAttachments(channelId: string) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: getChannelAttachmentsQueryKeyPrefix(channelId),
refetchType: 'inactive',
});
diff --git a/apps/web/src/lib/queries/channel/participants.ts b/apps/web/src/lib/queries/channel/participants.ts
index f02b9b7c74..9d8a387ab2 100644
--- a/apps/web/src/lib/queries/channel/participants.ts
+++ b/apps/web/src/lib/queries/channel/participants.ts
@@ -31,7 +31,7 @@ function optimisticAddParticipants(
const participantsQueryKey = channelKeys.participants(
vars.channelId
).queryKey;
- queryClient.cancelQueries({ queryKey: participantsQueryKey });
+ void queryClient.cancelQueries({ queryKey: participantsQueryKey });
let context: AddParticipantsContext | undefined;
queryClient.setQueryData(
@@ -96,7 +96,7 @@ function optimisticRemoveParticipants(
const participantsQueryKey = channelKeys.participants(
vars.channelId
).queryKey;
- queryClient.cancelQueries({ queryKey: participantsQueryKey });
+ void queryClient.cancelQueries({ queryKey: participantsQueryKey });
let context: RemoveParticipantsContext | undefined;
diff --git a/apps/web/src/lib/queries/chat.ts b/apps/web/src/lib/queries/chat.ts
index 40ab03ccb1..dc10ee6f3f 100644
--- a/apps/web/src/lib/queries/chat.ts
+++ b/apps/web/src/lib/queries/chat.ts
@@ -44,12 +44,12 @@ export function useChatRenameWebsocketSync() {
if (data.type !== CHAT_RENAMED_MESSAGE_TYPE || !data.chat_id) return;
- queryClient.invalidateQueries({ queryKey: ['chat', data.chat_id] });
- queryClient.invalidateQueries({ queryKey: ['entity'] });
- queryClient.invalidateQueries({ queryKey: historyKeys.list.queryKey });
- queryClient.invalidateQueries({ queryKey: soupKeys.items._def });
- queryClient.invalidateQueries({ queryKey: soupKeys.astItems._def });
- queryClient.invalidateQueries({ queryKey: soupKeys.search._def });
- invalidatePreview(data.chat_id);
+ void queryClient.invalidateQueries({ queryKey: ['chat', data.chat_id] });
+ void queryClient.invalidateQueries({ queryKey: ['entity'] });
+ void queryClient.invalidateQueries({ queryKey: historyKeys.list.queryKey });
+ void queryClient.invalidateQueries({ queryKey: soupKeys.items._def });
+ void queryClient.invalidateQueries({ queryKey: soupKeys.astItems._def });
+ void queryClient.invalidateQueries({ queryKey: soupKeys.search._def });
+ void invalidatePreview(data.chat_id);
});
}
diff --git a/apps/web/src/lib/queries/email/backfill.ts b/apps/web/src/lib/queries/email/backfill.ts
index 444f513fe1..e22344765b 100644
--- a/apps/web/src/lib/queries/email/backfill.ts
+++ b/apps/web/src/lib/queries/email/backfill.ts
@@ -130,7 +130,7 @@ export function useBackfillJobsQuery() {
* (the query otherwise only fires on mount).
*/
export function invalidateBackfillJobs() {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.backfillJobs.queryKey,
});
}
diff --git a/apps/web/src/lib/queries/email/link.ts b/apps/web/src/lib/queries/email/link.ts
index 86bab9669f..37828059e9 100644
--- a/apps/web/src/lib/queries/email/link.ts
+++ b/apps/web/src/lib/queries/email/link.ts
@@ -134,8 +134,8 @@ export function invalidateEmailLinks() {
// Connection, reauthorization and link-removal events must refresh the
// GraphQL catalog consumed by both From and the sidebar, not only legacy reads.
void refreshSenderCatalog();
- queryClient.cancelQueries({ queryKey: emailKeys.links.queryKey });
- queryClient.invalidateQueries({
+ void queryClient.cancelQueries({ queryKey: emailKeys.links.queryKey });
+ void queryClient.invalidateQueries({
queryKey: emailKeys.links.queryKey,
});
}
diff --git a/apps/web/src/lib/queries/email/thread.ts b/apps/web/src/lib/queries/email/thread.ts
index ed447aa3bc..8f52436da7 100644
--- a/apps/web/src/lib/queries/email/thread.ts
+++ b/apps/web/src/lib/queries/email/thread.ts
@@ -525,10 +525,10 @@ export async function trackExternalThreadArchive(
}
} finally {
if (disposition !== 'queued') {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.threadMessages(threadId).queryKey,
});
- queryClient.invalidateQueries({ queryKey: emailKeys.previews._def });
+ void queryClient.invalidateQueries({ queryKey: emailKeys.previews._def });
}
}
}
@@ -559,10 +559,10 @@ async function replayThreadArchive(
throw err;
} finally {
if (disposition !== 'queued') {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.threadMessages(params.threadId).queryKey,
});
- queryClient.invalidateQueries({ queryKey: emailKeys.previews._def });
+ void queryClient.invalidateQueries({ queryKey: emailKeys.previews._def });
}
}
}
@@ -609,10 +609,10 @@ export function useUndoableArchiveThreadMutation(options: {
},
onSettled: (disposition, _error, params) => {
if (disposition === 'queued') return;
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.threadMessages(params.threadId).queryKey,
});
- queryClient.invalidateQueries({ queryKey: emailKeys.previews._def });
+ void queryClient.invalidateQueries({ queryKey: emailKeys.previews._def });
},
undoFn: async (params, context) => {
const disposition = await replayThreadArchive({
@@ -723,14 +723,14 @@ function _useScheduleMessageMutation(
{
onSuccess: (_data, vars) => {
if (vars.threadID) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.threadMessages(vars.threadID).queryKey,
});
}
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.previews._def,
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: emailKeys.scheduledMessages._def,
});
},
diff --git a/apps/web/src/lib/queries/gtm-invite/links.ts b/apps/web/src/lib/queries/gtm-invite/links.ts
index 9ba6f0952e..3d31e5785b 100644
--- a/apps/web/src/lib/queries/gtm-invite/links.ts
+++ b/apps/web/src/lib/queries/gtm-invite/links.ts
@@ -57,7 +57,7 @@ export function useCreateGtmInviteLinkMutation(
...withCallbacks<GtmInviteLink, Error, CreateGtmInviteLinkRequest>(
{
onSuccess: () => {
- invalidateGtmInviteLinks();
+ void invalidateGtmInviteLinks();
},
onError: (error) => {
toast.failure(error.message || "Couldn't create the invite link");
@@ -84,7 +84,7 @@ export function useRevokeGtmInviteLinkMutation(
...withCallbacks<GtmInviteLink, Error, RevokeLinkArgs>(
{
onSuccess: () => {
- invalidateGtmInviteLinks();
+ void invalidateGtmInviteLinks();
toast.success('Invite link revoked');
},
onError: (error) => {
@@ -152,7 +152,7 @@ export function useRedeemGtmInviteLinkMutation(callbacks?: RedeemCallbacks) {
...withCallbacks<GtmInviteOffer, Error, RedeemArgs>(
{
onSuccess: () => {
- invalidateGtmInviteOffer();
+ void invalidateGtmInviteOffer();
},
},
callbacks
diff --git a/apps/web/src/lib/queries/history/history.ts b/apps/web/src/lib/queries/history/history.ts
index 25134c0404..10ae7b08a3 100644
--- a/apps/web/src/lib/queries/history/history.ts
+++ b/apps/web/src/lib/queries/history/history.ts
@@ -231,7 +231,7 @@ export function useUpsertToHistoryMutation(
}
},
onSettled: () => {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: historyQueryOptions.queryKey,
});
},
@@ -306,7 +306,7 @@ async function _insertProjectIntoHistory(projectId: string) {
const newData: HistoryItem[] = [];
const ids = [projectId];
- storageServiceClient.upsertItemToUserHistory({
+ await storageServiceClient.upsertItemToUserHistory({
itemId: projectId,
itemType: 'project',
});
diff --git a/apps/web/src/lib/queries/messages/mutations.ts b/apps/web/src/lib/queries/messages/mutations.ts
index 1f92d6e66b..8f1e067f2f 100644
--- a/apps/web/src/lib/queries/messages/mutations.ts
+++ b/apps/web/src/lib/queries/messages/mutations.ts
@@ -3,6 +3,7 @@ import type { OptimisticPostMessageAttachment } from '@channel/Input/message-pay
import { toast } from '@core/component/Toast/Toast';
import type { DateValue } from '@core/util/date';
import { markMessageSent } from '@core/util/message-send-motion';
+import { Telemetry } from '@macro-inc/observability';
import {
messageReferencesCrmRecord,
refreshCrmAssociatedSoupQueries,
@@ -500,7 +501,9 @@ export function useSendMessageMutation(
// this soup entity. Refresh root messages here so the channel moves to
// its updated position in soup lists.
if (threadId === undefined && variables.parent.type === 'channel') {
- refetchSoupEntity(variables.parent.id, 'channel');
+ refetchSoupEntity(variables.parent.id, 'channel').catch((error) =>
+ Telemetry.error(error, { surface: 'messages' })
+ );
invalidateSoupEntity(variables.parent.id);
}
diff --git a/apps/web/src/lib/queries/messages/thread-replies.ts b/apps/web/src/lib/queries/messages/thread-replies.ts
index 1604f1f541..b628e9740d 100644
--- a/apps/web/src/lib/queries/messages/thread-replies.ts
+++ b/apps/web/src/lib/queries/messages/thread-replies.ts
@@ -162,7 +162,7 @@ export function softInvalidateThreadReplies(
parent: MessageParent,
messageId: string
) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: getThreadRepliesQueryKey(parent, messageId),
refetchType: 'inactive',
});
diff --git a/apps/web/src/lib/queries/messages/timeline.ts b/apps/web/src/lib/queries/messages/timeline.ts
index 746f044c85..3f9607110e 100644
--- a/apps/web/src/lib/queries/messages/timeline.ts
+++ b/apps/web/src/lib/queries/messages/timeline.ts
@@ -733,7 +733,7 @@ export function findThreadPreviewReplySnapshotInMessageTimeline(
* Marks the channel messages query as stale without triggering an immediate refetch.
*/
export function softInvalidateMessageTimeline(parent: MessageParent) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: getMessageTimelineQueryKeyPrefix(parent),
refetchType: 'inactive',
});
@@ -745,7 +745,7 @@ function getMessageTimelineByIdsQueryKeyPrefix(parent: MessageParent) {
}
export function softInvalidateMessageTimelineByIds(parent: MessageParent) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: getMessageTimelineByIdsQueryKeyPrefix(parent),
refetchType: 'inactive',
});
diff --git a/apps/web/src/lib/queries/notification/user-notifications.ts b/apps/web/src/lib/queries/notification/user-notifications.ts
index cae40fb74c..1fc8801568 100644
--- a/apps/web/src/lib/queries/notification/user-notifications.ts
+++ b/apps/web/src/lib/queries/notification/user-notifications.ts
@@ -530,7 +530,7 @@ function notificationsMutationSuccessCallback(
_: UpdateNotificationsResult,
_params: NotificationsMutationParams
) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: notificationKeys.user._def,
refetchType: 'none',
});
@@ -891,7 +891,7 @@ export function applyNotificationStatusUpdate(
};
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: notificationKeys.user._def,
refetchType: 'none',
});
@@ -977,7 +977,7 @@ export function restoreUserNotifications(notifications: NotificationItem[]) {
};
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: notificationKeys.user._def,
refetchType: 'none',
});
@@ -1012,7 +1012,7 @@ export function optimisticInsertNotification(
// Cache is already updated via setQueriesData above. Mark as stale without
// refetching — refetchType default would re-fetch every cached page of the
// infinite notification query for every incoming websocket notification.
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: notificationKeys.user._def,
refetchType: 'none',
});
diff --git a/apps/web/src/lib/queries/preview/dataloader.ts b/apps/web/src/lib/queries/preview/dataloader.ts
index a216455617..3a13f4b985 100644
--- a/apps/web/src/lib/queries/preview/dataloader.ts
+++ b/apps/web/src/lib/queries/preview/dataloader.ts
@@ -83,7 +83,7 @@ class PreviewDataLoader {
existing.push({ item, resolve, reject });
} else {
this.pendingRequests.set(key, [{ item, resolve, reject }]);
- this.batcher.addItem(item);
+ void this.batcher.addItem(item);
}
});
}
diff --git a/apps/web/src/lib/queries/preview/preview.ts b/apps/web/src/lib/queries/preview/preview.ts
index 6e40f8ac02..6f0b23865b 100644
--- a/apps/web/src/lib/queries/preview/preview.ts
+++ b/apps/web/src/lib/queries/preview/preview.ts
@@ -369,7 +369,7 @@ export function setPreviewName({
// mark stale for the next natural refetch (mount/focus) without refetching
// active observers now: the backend may not have processed the rename yet,
// so an immediate refetch could clobber the optimistic name with the old one
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: previewKeys.item(itemId).queryKey,
refetchType: 'none',
});
diff --git a/apps/web/src/lib/queries/preview/tests/preview.test.ts b/apps/web/src/lib/queries/preview/tests/preview.test.ts
index 72424b0578..3d4197378e 100644
--- a/apps/web/src/lib/queries/preview/tests/preview.test.ts
+++ b/apps/web/src/lib/queries/preview/tests/preview.test.ts
@@ -309,8 +309,8 @@ describe('preview transport facade', () => {
expect(setQueryDataMock).not.toHaveBeenCalled();
});
- it('invalidates only active REST fallbacks under the GraphQL flag', () => {
- invalidatePreview('doc-1');
+ it('invalidates only active REST fallbacks under the GraphQL flag', async () => {
+ await invalidatePreview('doc-1');
const options = invalidateQueriesMock.mock.calls[0]?.[0];
expect(options.queryKey).toContain('doc-1');
diff --git a/apps/web/src/lib/queries/preview/wakeup.ts b/apps/web/src/lib/queries/preview/wakeup.ts
index 7556ab2968..bd2de9f180 100644
--- a/apps/web/src/lib/queries/preview/wakeup.ts
+++ b/apps/web/src/lib/queries/preview/wakeup.ts
@@ -62,7 +62,7 @@ function enqueueDocumentIdWakeup(documentId: string) {
recentWakeups.set(documentId, now);
cleanupRecentWakeups(now);
- documentWakeupBatcher.addItem(documentId);
+ void documentWakeupBatcher.addItem(documentId);
}
type WakeableDocument = ItemLike & {
diff --git a/apps/web/src/lib/queries/properties/definitions.ts b/apps/web/src/lib/queries/properties/definitions.ts
index a411d0cba5..d9357245a3 100644
--- a/apps/web/src/lib/queries/properties/definitions.ts
+++ b/apps/web/src/lib/queries/properties/definitions.ts
@@ -76,7 +76,7 @@ export async function fetchPropertyDefinitionWithOptions(
}
function invalidatePropertyDefinitions() {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
predicate: ({ queryKey }) =>
queryKey.includes('properties') && queryKey.includes('definitions'),
});
diff --git a/apps/web/src/lib/queries/properties/options.ts b/apps/web/src/lib/queries/properties/options.ts
index b3ad33b947..0cb75c8de1 100644
--- a/apps/web/src/lib/queries/properties/options.ts
+++ b/apps/web/src/lib/queries/properties/options.ts
@@ -42,7 +42,7 @@ export function usePropertyOptionsQuery(
}
function invalidatePropertyOptions(propertyDefinitionId: string) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: propertiesKeys.options({ propertyDefinitionId }).queryKey,
});
}
diff --git a/apps/web/src/lib/queries/properties/tags.ts b/apps/web/src/lib/queries/properties/tags.ts
index f3614be651..56db3a28c4 100644
--- a/apps/web/src/lib/queries/properties/tags.ts
+++ b/apps/web/src/lib/queries/properties/tags.ts
@@ -35,7 +35,9 @@ export function useTagsQuery() {
}
export function invalidateTags() {
- queryClient.invalidateQueries({ queryKey: propertiesKeys.tags.queryKey });
+ void queryClient.invalidateQueries({
+ queryKey: propertiesKeys.tags.queryKey,
+ });
}
/**
@@ -45,11 +47,11 @@ export function invalidateTags() {
* would have to enumerate ids the client doesn't know.
*/
export function invalidateAllProperties() {
- queryClient.invalidateQueries({ queryKey: propertiesKeys._def });
+ void queryClient.invalidateQueries({ queryKey: propertiesKeys._def });
}
function invalidatePropertyOptions(propertyDefinitionId: string) {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: propertiesKeys.options({ propertyDefinitionId }).queryKey,
});
}
diff --git a/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts b/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts
index fb88f17ac8..40dbb67cfc 100644
--- a/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts
+++ b/apps/web/src/lib/queries/soup/normalized-cache/grouped-operations.ts
@@ -112,7 +112,7 @@ export function syncGroupedParents(entityId: string, entity: SoupApiItem) {
: computeGroupKeysForItem(entity, meta.groupBy);
if (nextGroupKeys === undefined) {
- queryClient.invalidateQueries({ queryKey: query.queryKey });
+ void queryClient.invalidateQueries({ queryKey: query.queryKey });
continue;
}
@@ -156,7 +156,7 @@ export function syncGroupedParents(entityId: string, entity: SoupApiItem) {
}
if (needsInvalidation) {
- queryClient.invalidateQueries({ queryKey: query.queryKey });
+ void queryClient.invalidateQueries({ queryKey: query.queryKey });
continue;
}
@@ -200,7 +200,7 @@ export function syncGroupQueries(entityId: string, entity: SoupApiItem) {
? []
: computeGroupKeysForItem(entity, meta.groupBy);
if (nextGroupKeys === undefined) {
- queryClient.invalidateQueries({ queryKey: query.queryKey });
+ void queryClient.invalidateQueries({ queryKey: query.queryKey });
continue;
}
@@ -321,7 +321,7 @@ export function insertGroupQueries(
const targetKeys = computeGroupKeysForItem(item, meta.groupBy);
if (targetKeys === undefined) {
- queryClient.invalidateQueries({ queryKey: query.queryKey });
+ void queryClient.invalidateQueries({ queryKey: query.queryKey });
continue;
}
if (!targetKeys.includes(meta.groupKey)) continue;
diff --git a/apps/web/src/lib/queries/soup/normalized-cache/operations.cancellation.test.ts b/apps/web/src/lib/queries/soup/normalized-cache/operations.cancellation.test.ts
index 0e3861106b..176da5ab53 100644
--- a/apps/web/src/lib/queries/soup/normalized-cache/operations.cancellation.test.ts
+++ b/apps/web/src/lib/queries/soup/normalized-cache/operations.cancellation.test.ts
@@ -220,7 +220,7 @@ describe('destination-folder refetch vs optimistic soup updates', () => {
expect(observer.getCurrentResult().data).toEqual(['thread-1']);
// Active observer + invalidation → refetch in flight.
- testQueryClient.invalidateQueries({ queryKey: sourceListKey });
+ void testQueryClient.invalidateQueries({ queryKey: sourceListKey });
await vi.waitFor(() => {
expect(source.state().fetchStatus).toBe('fetching');
});
@@ -248,7 +248,7 @@ describe('destination-folder refetch vs optimistic soup updates', () => {
const { observer } = source.mount();
await source.releaseNextFetch();
- testQueryClient.invalidateQueries({ queryKey: sourceListKey });
+ void testQueryClient.invalidateQueries({ queryKey: sourceListKey });
await vi.waitFor(() => {
expect(source.state().fetchStatus).toBe('fetching');
});
diff --git a/apps/web/src/lib/queries/soup/normalized-cache/operations.ts b/apps/web/src/lib/queries/soup/normalized-cache/operations.ts
index afbb6a0601..7c004e7f84 100644
--- a/apps/web/src/lib/queries/soup/normalized-cache/operations.ts
+++ b/apps/web/src/lib/queries/soup/normalized-cache/operations.ts
@@ -3,6 +3,7 @@ import {
enableGraphqlSoup,
isFeatureEnabled,
} from '@core/constant/featureFlags';
+import { Telemetry } from '@macro-inc/observability';
import type { UnifiedSearchResponseItem } from '@service-search/generated/models';
import type {
PostSoupRequest,
@@ -63,8 +64,11 @@ type SoupSearchInfiniteData = InfiniteData<
*/
function cancelSoupQueries() {
const predicate = (query: Query) => query.state.data !== undefined;
- queryClient.cancelQueries({ queryKey: soupKeys.items._def, predicate });
- queryClient.cancelQueries({ queryKey: soupKeys.astItems._def, predicate });
+ void queryClient.cancelQueries({ queryKey: soupKeys.items._def, predicate });
+ void queryClient.cancelQueries({
+ queryKey: soupKeys.astItems._def,
+ predicate,
+ });
}
/**
@@ -116,7 +120,7 @@ function updateSoupEntity<T extends SoupEntityTag>(
)
);
if (cancelHashes.size > 0) {
- queryClient.cancelQueries({
+ void queryClient.cancelQueries({
predicate: (query) =>
query.state.data !== undefined && cancelHashes.has(query.queryHash),
});
@@ -257,7 +261,7 @@ export function invalidateSoupEntity(entityId: string): void {
/** Mark stale soup queries whose query key references any of the given ids (e.g. project-scoped views). */
export function invalidateSoupQueriesReferencing(ids: string[]): void {
if (ids.length === 0) return;
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: ['soup'],
predicate: (query) => {
const serialized = JSON.stringify(query.queryKey);
@@ -268,16 +272,16 @@ export function invalidateSoupQueriesReferencing(ids: string[]): void {
/** Mark every soup list query stale. Use `invalidateSoupEntity` when the entity ID is known. */
export function invalidateAllSoup(): void {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: soupKeys.items._def,
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: soupKeys.astItems._def,
});
// Expanded single-group caches back grouped views' rows (mail/inbox group
// by date); leaving them stale keeps removed rows hidden even after their
// parent queries refetch.
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: soupKeys.groupedGroup._def,
});
}
@@ -364,7 +368,7 @@ export function insertSoupEntity(item: SoupApiItem): SoupTransaction {
);
if (!nextPage) {
- queryClient.invalidateQueries({ queryKey: key });
+ void queryClient.invalidateQueries({ queryKey: key });
continue;
}
@@ -519,7 +523,7 @@ export function restoreSoupEntityToDoneFilteredQueries(
if (flatMeta.itemFilter && !flatMeta.itemFilter(item)) continue;
if (flatMeta.insertFilter && !flatMeta.insertFilter(item)) continue;
- cancelQuery(key);
+ void cancelQuery(key);
queryClient.setQueryData<SoupItemsInfiniteData>(key, {
...prev,
pages: prev.pages.map((page, index) =>
@@ -553,7 +557,7 @@ export function restoreSoupEntityToDoneFilteredQueries(
continue;
}
- cancelQuery(key);
+ void cancelQuery(key);
queryClient.setQueryData<SoupAstItemsInfiniteData>(key, {
...prev,
pages: prev.pages.map((page, index) =>
@@ -576,11 +580,11 @@ export function restoreSoupEntityToDoneFilteredQueries(
const nextPage = insertGroupedPage(firstPage, item, entityId, meta.groupBy);
if (!nextPage) {
- queryClient.invalidateQueries({ queryKey: key });
+ void queryClient.invalidateQueries({ queryKey: key });
continue;
}
- cancelQuery(key);
+ void cancelQuery(key);
queryClient.setQueryData<SoupAstItemsInfiniteData>(key, {
...prev,
pages: [nextPage, ...prev.pages.slice(1)],
@@ -598,11 +602,11 @@ function removeSoupEntitiesWhere(
// Scoped equivalent of cancelSoupQueries (same data !== undefined guard)
const cancelPredicate = (query: Query) =>
query.state.data !== undefined && referencesIds(query.queryKey);
- queryClient.cancelQueries({
+ void queryClient.cancelQueries({
queryKey: soupKeys.items._def,
predicate: cancelPredicate,
});
- queryClient.cancelQueries({
+ void queryClient.cancelQueries({
queryKey: soupKeys.astItems._def,
predicate: cancelPredicate,
});
@@ -672,7 +676,7 @@ function removeSoupEntitiesWhere(
}
export function removeSearchEntities(entityIds: Set<string>): SoupTransaction {
- queryClient.cancelQueries({ queryKey: soupKeys.search._def });
+ void queryClient.cancelQueries({ queryKey: soupKeys.search._def });
const previous = queryClient.getQueriesData<SoupSearchInfiniteData>({
queryKey: soupKeys.search._def,
@@ -800,15 +804,15 @@ export async function refetchSoupEntity(
function invalidateAllSoupExceptTouched(): void {
const notTouched = (query: Query) =>
!JSON.stringify(query.queryKey).includes('touched_by_me');
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: soupKeys.items._def,
predicate: notTouched,
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: soupKeys.astItems._def,
predicate: notTouched,
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: soupKeys.groupedGroup._def,
predicate: notTouched,
});
@@ -882,6 +886,15 @@ export function buildSingleEntityFilter(
.exhaustive();
}
+async function updateRecentlyViewedItemLazily(
+ itemId: string,
+ viewedAt: string
+): Promise<void> {
+ // Lazy import to break circular dependency
+ const { updateRecentlyViewedItem } = await import('../recently-viewed');
+ updateRecentlyViewedItem(itemId, viewedAt);
+}
+
/**
* Optimistically update the viewedAt timestamp for a soup item.
* Updates the item across all soup queries if it exists.
@@ -889,10 +902,9 @@ export function buildSingleEntityFilter(
export function optimisticUpdateSoupItemViewedAt(itemId: string) {
const now = new Date().toISOString();
- // Lazy import to break circular dependency
- import('../recently-viewed').then(({ updateRecentlyViewedItem }) => {
- updateRecentlyViewedItem(itemId, now);
- });
+ updateRecentlyViewedItemLazily(itemId, now).catch((error) =>
+ Telemetry.error(error, { surface: 'soup-normalized-cache' })
+ );
const current = getSoupEntityById(itemId);
if (!current) return;
diff --git a/apps/web/src/lib/queries/storage/projects.ts b/apps/web/src/lib/queries/storage/projects.ts
index 617f50e18e..0977631e86 100644
--- a/apps/web/src/lib/queries/storage/projects.ts
+++ b/apps/web/src/lib/queries/storage/projects.ts
@@ -245,10 +245,10 @@ function _useCreateProjectMutation(
}
},
onSettled: () => {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: storageKeys.projects.list.queryKey,
});
- refetchHistory();
+ void refetchHistory();
},
},
callbacks
diff --git a/apps/web/src/lib/queries/storage/task-duplicates.ts b/apps/web/src/lib/queries/storage/task-duplicates.ts
index 7332af3a58..4ee098bafc 100644
--- a/apps/web/src/lib/queries/storage/task-duplicates.ts
+++ b/apps/web/src/lib/queries/storage/task-duplicates.ts
@@ -31,7 +31,7 @@ export function handleTaskDuplicateMatchesUpdated(
console.warn('Malformed task duplicate live update payload', payload);
return;
}
- invalidateTaskDuplicates(payload.documentId);
+ void invalidateTaskDuplicates(payload.documentId);
}
async function fetchTaskDuplicates(
@@ -70,9 +70,9 @@ export function useDismissTaskDuplicatesMutation(documentId: Accessor<string>) {
if (result.isErr()) throw new Error('Failed to dismiss duplicate');
},
onSuccess: (_data, params) => {
- invalidateTaskDuplicates(documentId());
+ void invalidateTaskDuplicates(documentId());
for (const otherDocumentId of params.otherDocumentIds ?? []) {
- invalidateTaskDuplicates(otherDocumentId);
+ void invalidateTaskDuplicates(otherDocumentId);
}
},
}));
diff --git a/apps/web/src/lib/queries/sync/use-query-sync.ts b/apps/web/src/lib/queries/sync/use-query-sync.ts
index 779e16b25e..d103612a7d 100644
--- a/apps/web/src/lib/queries/sync/use-query-sync.ts
+++ b/apps/web/src/lib/queries/sync/use-query-sync.ts
@@ -102,7 +102,7 @@ export function useQuerySync(userId: Accessor<string | undefined>): void {
);
})
.with({ type: 'contacts_invalidation' }, () => {
- invalidateContacts();
+ void invalidateContacts();
})
.with({ type: 'timeline_activity' }, () => {
withParsedWebsocketPayload(
diff --git a/apps/web/src/lib/queries/team/invitations.ts b/apps/web/src/lib/queries/team/invitations.ts
index 4f26f6abd3..ec051dd8da 100644
--- a/apps/web/src/lib/queries/team/invitations.ts
+++ b/apps/web/src/lib/queries/team/invitations.ts
@@ -47,7 +47,7 @@ export function useJoinTeamMutation(callbacks?: JoinTeamCallbacks) {
{
onSuccess: () => {
invalidateUserTeams();
- invalidateUserInvites();
+ void invalidateUserInvites();
toast.success('Joined team');
},
@@ -96,7 +96,7 @@ export function useRejectInvitationMutation(
>(
{
onSuccess: () => {
- invalidateUserInvites();
+ void invalidateUserInvites();
toast.success('Invitation declined');
},
diff --git a/apps/web/src/lib/queries/team/invites.ts b/apps/web/src/lib/queries/team/invites.ts
index ca0dcf0dc3..8c267c412d 100644
--- a/apps/web/src/lib/queries/team/invites.ts
+++ b/apps/web/src/lib/queries/team/invites.ts
@@ -41,7 +41,7 @@ export function useInviteToTeamMutation(callbacks?: InviteToTeamCallbacks) {
...withCallbacks<void, Error, InviteToTeamArgs>(
{
onSuccess: (_data, { teamId }) => {
- invalidateTeamInvites(teamId);
+ void invalidateTeamInvites(teamId);
toast.success('Invitation sent');
},
@@ -102,7 +102,7 @@ export function useDeleteTeamInviteMutation(
},
onSuccess: (_data, { teamId }) => {
- invalidateTeamInvites(teamId);
+ void invalidateTeamInvites(teamId);
toast.success('Invitation cancelled');
},
diff --git a/apps/web/src/lib/queries/team/members.ts b/apps/web/src/lib/queries/team/members.ts
index 10a5142050..7d2e20be24 100644
--- a/apps/web/src/lib/queries/team/members.ts
+++ b/apps/web/src/lib/queries/team/members.ts
@@ -61,7 +61,7 @@ export function useRemoveUserFromTeamMutation(
},
onSuccess: (_data, { teamId }) => {
- invalidateTeam(teamId);
+ void invalidateTeam(teamId);
toast.success('Member removed');
},
@@ -104,7 +104,7 @@ export function useSetTeamMemberPlanMutation(
...withCallbacks<void, Error, SetTeamMemberPlanArgs>(
{
onSuccess: (_data, { teamId, plan }) => {
- invalidateTeam(teamId);
+ void invalidateTeam(teamId);
void invalidateAiBillingSummary();
void invalidateSubscriptionStatus();
toast.success(
diff --git a/apps/web/src/lib/queries/team/teams.ts b/apps/web/src/lib/queries/team/teams.ts
index af98e25b11..7e6b2df571 100644
--- a/apps/web/src/lib/queries/team/teams.ts
+++ b/apps/web/src/lib/queries/team/teams.ts
@@ -91,10 +91,10 @@ export function useIsTeamOwner(): Accessor<boolean> {
}
export function invalidateUserTeams() {
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: teamKeys.userTeams.queryKey,
});
- queryClient.invalidateQueries({
+ void queryClient.invalidateQueries({
queryKey: teamKeys.currentTeam.queryKey,
});
}
@@ -142,7 +142,7 @@ export function usePatchTeamMutation(callbacks?: PatchTeamCallbacks) {
...withCallbacks<void, Error, PatchTeamArgs>(
{
onSuccess: (_data, { teamId }) => {
- invalidateTeam(teamId);
+ void invalidateTeam(teamId);
invalidateUserTeams();
toast.success('Team updated');
},
@@ -212,7 +212,7 @@ export function useToggleAutoJoinDomainMutation(
teamKeys.currentTeam.queryKey,
applyDomain
);
- invalidateTeam(teamId);
+ void invalidateTeam(teamId);
invalidateUserTeams();
toast.success(
data.auto_join_domain
@@ -277,7 +277,7 @@ export function useToggleNonAdminInvitesMutation(
teamKeys.currentTeam.queryKey,
applySetting
);
- invalidateTeam(teamId);
+ void invalidateTeam(teamId);
invalidateUserTeams();
toast.success(
data.allow_non_admin_invites
diff --git a/apps/web/src/lib/service-clients/service-agent-harness/client.test.ts b/apps/web/src/lib/service-clients/service-agent-harness/client.test.ts
index c90759ea9d..c34db9d1ef 100644
--- a/apps/web/src/lib/service-clients/service-agent-harness/client.test.ts
+++ b/apps/web/src/lib/service-clients/service-agent-harness/client.test.ts
@@ -20,7 +20,7 @@ function errorHandler() {
describe('session request errors', () => {
it('explains repository access failures on create', async () => {
- agentHarnessServiceClient.create({});
+ await agentHarnessServiceClient.create({});
const error = await errorHandler()(
new Response('repository is not available to this user', { status: 403 })
);
@@ -28,7 +28,7 @@ describe('session request errors', () => {
});
it('preserves the service reason when a control request is rejected', async () => {
- agentHarnessServiceClient.control('session-1', {
+ await agentHarnessServiceClient.control('session-1', {
type: 'setModel',
model: 'missing',
});
@@ -39,7 +39,7 @@ describe('session request errors', () => {
});
it('does not display an HTML proxy error as a service message', async () => {
- agentHarnessServiceClient.create({});
+ await agentHarnessServiceClient.create({});
const error = await errorHandler()(
new Response('<html>upstream failure</html>', {
status: 502,
@@ -51,16 +51,16 @@ describe('session request errors', () => {
});
describe('repository listing', () => {
- it("asks the harness for the caller's repositories", () => {
- agentHarnessServiceClient.listRepositories();
+ it("asks the harness for the caller's repositories", async () => {
+ await agentHarnessServiceClient.listRepositories();
expect(fetchWithToken).toHaveBeenCalledWith(
'https://harness.example.com/agent-repositories',
{ method: 'GET' }
);
});
- it("asks the harness for one repository's branches", () => {
- agentHarnessServiceClient.listRepositoryBranches(
+ it("asks the harness for one repository's branches", async () => {
+ await agentHarnessServiceClient.listRepositoryBranches(
'https://github.com/macro-inc/macro'
);
expect(fetchWithToken).toHaveBeenCalledWith(
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts
index 340cddefd6..c7210760bc 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts
@@ -186,7 +186,7 @@ describe('channel unread edge revalidation', () => {
{ document: ChannelUnreadPresenceDocument, variables: { input: {} } },
])
);
- handler.onPatch(newNotification);
+ await handler.onPatch(newNotification);
await vi.advanceTimersByTimeAsync(100);
expect(query).toHaveBeenCalledTimes(2);
expect(query.mock.calls.map(([document]) => document)).toEqual([
@@ -199,10 +199,10 @@ describe('channel unread edge revalidation', () => {
it('coalesces new notifications with pending deletions', async () => {
const { handler, query } = setup();
- handler.onPatch(deleted);
+ await handler.onPatch(deleted);
await vi.advanceTimersByTimeAsync(50);
expect(query).not.toHaveBeenCalled();
- handler.onPatch(newNotification);
+ await handler.onPatch(newNotification);
await vi.advanceTimersByTimeAsync(50);
expect(query).toHaveBeenCalledOnce();
await vi.advanceTimersByTimeAsync(1000);
@@ -216,10 +216,10 @@ describe('channel unread edge revalidation', () => {
finish = () => resolve({ data: {} });
});
query.mockImplementationOnce(() => ({ toPromise: () => pending }));
- handler.onPatch(newNotification);
+ await handler.onPatch(newNotification);
await vi.advanceTimersByTimeAsync(100);
- handler.onPatch(newNotification);
- handler.onPatch(deleted);
+ await handler.onPatch(newNotification);
+ await handler.onPatch(deleted);
await vi.advanceTimersByTimeAsync(1000);
expect(query).toHaveBeenCalledOnce();
finish?.();
@@ -232,7 +232,7 @@ describe('channel unread edge revalidation', () => {
it('keeps new-notification refreshes deferred while hidden', async () => {
const { handler, query } = setup();
vi.spyOn(document, 'hidden', 'get').mockReturnValue(true);
- handler.onPatch(newNotification);
+ await handler.onPatch(newNotification);
await vi.advanceTimersByTimeAsync(1000);
expect(query).not.toHaveBeenCalled();
vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);
@@ -272,8 +272,8 @@ describe('channel unread edge revalidation', () => {
});
it('coalesces updates into bounded-query refreshes, never full history', async () => {
const { handler, query } = setup();
- handler.onPatch(deleted);
- handler.onPatch(deleted);
+ await handler.onPatch(deleted);
+ await handler.onPatch(deleted);
handler.reconnect();
await vi.advanceTimersByTimeAsync(301);
expect(query).toHaveBeenCalledOnce();
@@ -287,7 +287,7 @@ describe('channel unread edge revalidation', () => {
it('defers hidden-tab work and cancels scheduled work on client disposal', async () => {
const { handler, query, client } = setup();
vi.spyOn(document, 'hidden', 'get').mockReturnValue(true);
- handler.onPatch(deleted);
+ await handler.onPatch(deleted);
await vi.advanceTimersByTimeAsync(1000);
expect(query).not.toHaveBeenCalled();
vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);
diff --git a/apps/web/src/lib/service-clients/service-storage/util/refetchResources.ts b/apps/web/src/lib/service-clients/service-storage/util/refetchResources.ts
index a8a4bb3416..c0a8dd2b62 100644
--- a/apps/web/src/lib/service-clients/service-storage/util/refetchResources.ts
+++ b/apps/web/src/lib/service-clients/service-storage/util/refetchResources.ts
@@ -8,11 +8,11 @@ import { invalidateProjects } from '@queries/storage/projects';
export function refetchResources() {
// TODO: fetch documents
// refetchDocuments();
- invalidateUserQuota();
- refetchHistory();
- refetchProjectResources();
- invalidateDeletedItems();
- invalidatePreview();
+ void invalidateUserQuota();
+ void refetchHistory();
+ void refetchProjectResources();
+ void invalidateDeletedItems();
+ void invalidatePreview();
}
async function refetchProjectResources(_force = false) {
diff --git a/apps/web/src/lib/service-clients/service-storage/util/upload.ts b/apps/web/src/lib/service-clients/service-storage/util/upload.ts
index 8936bcbdba..27bf693f5c 100644
--- a/apps/web/src/lib/service-clients/service-storage/util/upload.ts
+++ b/apps/web/src/lib/service-clients/service-storage/util/upload.ts
@@ -223,7 +223,7 @@ async function uploadWithProgress(
const projectIdPromise = waitBulkUploadStatus(requestId);
- projectIdPromise.then((projectId) => {
+ void projectIdPromise.then((projectId) => {
if (projectId) {
toast.success(`Uploaded ${name}`);
} else {
diff --git a/apps/web/src/lib/service-clients/service-storage/util/websocketPromiseChain.ts b/apps/web/src/lib/service-clients/service-storage/util/websocketPromiseChain.ts
index e8670ddc97..b0e5545ada 100644
--- a/apps/web/src/lib/service-clients/service-storage/util/websocketPromiseChain.ts
+++ b/apps/web/src/lib/service-clients/service-storage/util/websocketPromiseChain.ts
@@ -70,7 +70,7 @@ export function createWebsocketPromiseChain<
}
}, timeoutMs);
}) as PromiseHandler;
- promise.finally(() => {
+ void promise.finally(() => {
promise.resolved = true;
});
@@ -133,7 +133,7 @@ export function createWebsocketPromiseChain<
ws.addEventListener('message', messageHandler);
ws.addEventListener('close', closeHandler);
- Promise.allSettled(results).then(() => {
+ void Promise.allSettled(results).then(() => {
ws.removeEventListener('message', messageHandler);
ws.removeEventListener('close', closeHandler);
});
diff --git a/apps/web/src/lib/split-router/history/solid-router.ts b/apps/web/src/lib/split-router/history/solid-router.ts
index 98d4919889..0bf0db6d85 100644
--- a/apps/web/src/lib/split-router/history/solid-router.ts
+++ b/apps/web/src/lib/split-router/history/solid-router.ts
@@ -157,7 +157,7 @@ export function createSolidRouterHistory(
const revertTo = (previous: Position, landed: HistorySlice | undefined) =>
new Promise<void>((resolve) => {
reverting.push(resolve);
- revertChange(landed, previous.index, {
+ void revertChange(landed, previous.index, {
go: (delta) => navigate(delta),
replace: () => navigateTo(previous.location, previous.index, true),
});
diff --git a/apps/web/src/lib/split-router/router/runner.ts b/apps/web/src/lib/split-router/router/runner.ts
index be02b2bf4b..99bedb6840 100644
--- a/apps/web/src/lib/split-router/router/runner.ts
+++ b/apps/web/src/lib/split-router/router/runner.ts
@@ -138,16 +138,16 @@ export function createRunner(options: {
}) {
const inFlight = createInFlight();
const settlers = new WeakMap<Navigation, Settle>();
- const outstanding: Promise<unknown>[] = [];
+ const outstanding = new Set<Promise<unknown>>();
const waiters: (() => void)[] = [];
const paneRuns: PaneRun[] = [];
let committing = 0;
let disposed = false;
const track = async (promise: Promise<unknown>) => {
- outstanding.push(promise);
+ outstanding.add(promise);
await promise;
- outstanding.splice(outstanding.indexOf(promise), 1);
+ outstanding.delete(promise);
};
/** Starts `navigation`; one that never waits has settled by the time `start` returns. */
@@ -439,7 +439,7 @@ export function createRunner(options: {
/** Resolves once nothing is in flight. */
async settled(): Promise<void> {
- while (outstanding.length > 0) {
+ while (outstanding.size > 0) {
await Promise.all(outstanding);
}
},
diff --git a/apps/web/src/lib/split-router/tests/history.test.ts b/apps/web/src/lib/split-router/tests/history.test.ts
index 1d598d4aec..368d649566 100644
--- a/apps/web/src/lib/split-router/tests/history.test.ts
+++ b/apps/web/src/lib/split-router/tests/history.test.ts
@@ -54,14 +54,14 @@ describe('memory history', () => {
expect(history.entries().map((entry) => entry.path)).toEqual(['/a', '/c']);
});
- it('reports traversal and reverts it', () => {
+ it('reports traversal and reverts it', async () => {
const history = createMemoryHistory('/a');
history.write(at('/b'), { mode: 'push' });
const changes: ExternalChange[] = [];
history.subscribe((change) => changes.push(change));
history.back();
expect(changes.map((change) => change.location.path)).toEqual(['/a']);
- changes[0]!.revert();
+ await changes[0]!.revert();
expect(history.read().path).toBe('/b');
});
diff --git a/apps/web/src/lib/split-router/tests/router.test.ts b/apps/web/src/lib/split-router/tests/router.test.ts
index 2c17bca804..03bf43268f 100644
--- a/apps/web/src/lib/split-router/tests/router.test.ts
+++ b/apps/web/src/lib/split-router/tests/router.test.ts
@@ -181,9 +181,9 @@ describe('split router', () => {
expect(history.entries().map((entry) => entry.path)).toEqual(['/home']);
});
- it('turns a pane navigation outside the shared top-level route into a whole-window one, and Back rebuilds the panes', () => {
+ it('turns a pane navigation outside the shared top-level route into a whole-window one, and Back rebuilds the panes', async () => {
const { router, history, pane } = track(setup('/home/~/mail'));
- router.navigatePane(pane(1), '/login');
+ await router.navigatePane(pane(1), '/login');
expect(
router.panes().map((id) => router.entry(id)?.location.route.matches)
).toEqual([[{ id: 'login', params: {} }]]);
@@ -199,23 +199,23 @@ describe('split router', () => {
]);
});
- it('skips entries under another top-level route on pane Back while other panes share the app route', () => {
+ it('skips entries under another top-level route on pane Back while other panes share the app route', async () => {
const { router, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/login');
- router.navigatePane(pane(0), '/mail');
- router.open('/drive', { newPane: true, source: pane(0) });
+ await router.navigatePane(pane(0), '/login');
+ await router.navigatePane(pane(0), '/mail');
+ await router.open('/drive', { newPane: true, source: pane(0) });
expect(router.panes()).toHaveLength(2);
expect(router.canGo(pane(0), -1)).toBe(true);
- router.navigatePane(pane(0), -1);
+ await router.navigatePane(pane(0), -1);
expect(routeIds(router.entry(pane(0)))).toEqual(['home']);
expect(router.canGo(pane(0), -1)).toBe(false);
});
- it('pane back replaces the browser entry and records how the pane arrived', () => {
+ it('pane back replaces the browser entry and records how the pane arrived', async () => {
const { router, history, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
- router.navigatePane(pane(0), -1);
+ await router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), -1);
expect(routeIds(router.entry(pane(0)))).toEqual(['home']);
expect(router.arrival(pane(0))).toBe('back');
expect(router.canGo(pane(0), 1)).toBe(true);
@@ -225,9 +225,9 @@ describe('split router', () => {
]);
});
- it('browser back brings a pane back through its own history', () => {
+ it('browser back brings a pane back through its own history', async () => {
const { router, history, paneStore, pane } = track(setup('/home/~/drive'));
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
const drive = router.entry(pane(1));
history.back();
expect(routeIds(router.entry(pane(0)))).toEqual(['home']);
@@ -237,9 +237,9 @@ describe('split router', () => {
expect(router.entry(pane(1))).toBe(drive);
});
- it('a leave guard can refuse browser back, and the URL is put back', () => {
+ it('a leave guard can refuse browser back, and the URL is put back', async () => {
const { router, history, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, () => false);
history.back();
expect(routeIds(router.entry(pane(0)))).toEqual(['mail']);
@@ -252,7 +252,7 @@ describe('split router', () => {
const { router, solid } = track(setupSolid('/app/home'));
vi.runAllTimers();
const pane = router.panes()[0]!;
- router.navigatePane(pane, '/mail');
+ await router.navigatePane(pane, '/mail');
vi.runAllTimers();
const mail = router.entry(pane);
router.registerGuard(pane, PANE_ROUTE_LEVEL, () => false);
@@ -270,7 +270,7 @@ describe('split router', () => {
const { router, solid } = track(setupSolid('/app/drive'));
vi.runAllTimers();
const pane = router.panes()[0]!;
- router.updateSearch(pane, 'drive', { sort: ['date'] });
+ await router.updateSearch(pane, 'drive', { sort: ['date'] });
vi.runAllTimers();
const current = router.entry(pane);
const guard = vi.fn(() => false);
@@ -354,7 +354,7 @@ describe('split router', () => {
it('browser back cancels a pane navigation still in flight', async () => {
const { router, history, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
let allow: (allowed: boolean) => void = () => {};
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, ({ cause }) =>
cause === 'external'
@@ -406,7 +406,7 @@ describe('split router', () => {
const { router, solid } = track(setupSolid('/app/home'));
vi.runAllTimers();
const pane = router.panes()[0]!;
- router.navigatePane(pane, '/mail');
+ await router.navigatePane(pane, '/mail');
vi.runAllTimers();
router.registerGuard(pane, PANE_ROUTE_LEVEL, never);
solid.traverse(-1);
@@ -419,9 +419,9 @@ describe('split router', () => {
expect(solid.calls.map(([to]) => to)).toEqual(['/home', '/mail', 1]);
});
- it('a pane command cancels a pending browser back and reverts it first', () => {
+ it('a pane command cancels a pending browser back and reverts it first', async () => {
const { router, history, pane } = track(setup('/home/~/drive'));
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
let guardSignal: AbortSignal | undefined;
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, ({ signal }) => {
guardSignal = signal;
@@ -449,7 +449,7 @@ describe('split router', () => {
const { router, solid } = track(setupSolid('/app/home'));
vi.runAllTimers();
const pane = router.panes()[0]!;
- router.navigatePane(pane, '/mail');
+ await router.navigatePane(pane, '/mail');
vi.runAllTimers();
router.registerGuard(pane, PANE_ROUTE_LEVEL, ({ cause }) =>
cause === 'external' ? never() : true
@@ -486,7 +486,7 @@ describe('split router', () => {
],
})
);
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
slow = true;
history.back();
expect(routeIds(router.pending(pane(0))?.to)).toEqual(['home']);
@@ -506,12 +506,12 @@ describe('split router', () => {
).toMatchObject({ status: 'committed' });
});
- it('tells the policy who shows a new pane’s destination and whether a duplicate is allowed', () => {
+ it('tells the policy who shows a new pane’s destination and whether a duplicate is allowed', async () => {
const testPolicy = createTestPolicy();
const { router, pane } = track(setup('/md/d1/~/home', {}, testPolicy));
const target = { newPane: true as const, source: pane(1) };
- router.open('/md/d1', target, { allowDuplicate: true });
+ await router.open('/md/d1', target, { allowDuplicate: true });
expect(testPolicy.placements).toMatchObject([
{ holder: pane(0), allowDuplicate: true },
@@ -545,27 +545,28 @@ describe('split router', () => {
);
const opened = router.open('/md/d1', { newPane: true, source: pane(1) });
- router.navigatePane(pane(0), '/md/d1');
+ const navigated = router.navigatePane(pane(0), '/md/d1');
release();
await expect(opened).resolves.toEqual({
status: 'activated',
owner: pane(0),
});
+ await navigated;
expect(router.panes()).toHaveLength(2);
});
- it('skips entries another pane shows on Back and Forward, unless duplicates are allowed', () => {
+ it('skips entries another pane shows on Back and Forward, unless duplicates are allowed', async () => {
const { router, pane } = track(setup('/home/~/home'));
- router.navigatePane(pane(0), '/md/d1');
- router.navigatePane(pane(0), '/drive');
- router.navigatePane(pane(1), '/md/d1');
+ await router.navigatePane(pane(0), '/md/d1');
+ await router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(1), '/md/d1');
- router.navigatePane(pane(0), -1);
+ await router.navigatePane(pane(0), -1);
expect(routeIds(router.entry(pane(0)))).toEqual(['home']);
expect(router.canGo(pane(0), 1)).toBe(true);
- router.navigatePane(pane(0), 1, { allowDuplicate: true });
+ await router.navigatePane(pane(0), 1, { allowDuplicate: true });
expect(routeIds(router.entry(pane(0)))).toEqual(['block']);
});
@@ -584,16 +585,16 @@ describe('split router', () => {
expect(activated).toEqual([]);
});
- it('browser back brings back a duplicate', () => {
+ it('browser back brings back a duplicate', async () => {
const { router, history, activated, pane } = track(setup('/home/~/md/d1'));
- router.navigatePane(pane(0), '/md/d1', { allowDuplicate: true });
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/md/d1', { allowDuplicate: true });
+ await router.navigatePane(pane(0), '/drive');
history.back();
expect(routeIds(router.entry(pane(0)))).toEqual(['block']);
expect(activated).toEqual([]);
});
- it('opens and closes panes where the policy places them', () => {
+ it('opens and closes panes where the policy places them', async () => {
const { router, history } = track(setup('/home/~/drive'));
expect(
router.open('/mail', {
@@ -614,7 +615,7 @@ describe('split router', () => {
expect(history.read().path).toBe('/home');
expect(router.close('pane-1' as PaneId)).toBe(false);
- router.navigatePane('pane-1' as PaneId, '/mail');
+ await router.navigatePane('pane-1' as PaneId, '/mail');
expect(router.close('pane-1' as PaneId)).toBe(true);
expect(router.panes()).toEqual(['pane-1']);
expect(history.read().path).toBe('/home');
@@ -702,11 +703,11 @@ describe('split router', () => {
]);
});
- it('keeps panes that already show their entry when a base navigation reorders them', () => {
+ it('keeps panes that already show their entry when a base navigation reorders them', async () => {
const { router, history } = track(setup('/home/~/mail'));
const [home] = router.panes();
- router.navigate('/drive/~/home');
+ await router.navigate('/drive/~/home');
expect(router.panes().map((id) => routeIds(router.entry(id)))).toEqual([
['drive'],
['home'],
@@ -714,13 +715,13 @@ describe('split router', () => {
expect(router.panes()[1]).toBe(home);
expect(history.read().path).toBe('/drive/~/home');
- router.navigate({ location: location('mail') });
+ await router.navigate({ location: location('mail') });
expect(router.panes().map((id) => routeIds(router.entry(id)))).toEqual([
['mail'],
]);
});
- it('closing the last pane can go back to an earlier entry', () => {
+ it('closing the last pane can go back to an earlier entry', async () => {
const closeLast: SplitCloseAction = {
type: 'back-to',
to: (entry) => routeIds(entry)?.[0] === 'mail',
@@ -729,7 +730,7 @@ describe('split router', () => {
const { router, pane } = track(
setup('/mail', {}, createTestPolicy({ closeLast }))
);
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/drive');
expect(router.close(pane(0))).toBe(true);
expect(routeIds(router.entry(pane(0)))).toEqual(['mail']);
expect(router.canGo(pane(0), 1)).toBe(true);
@@ -836,10 +837,10 @@ describe('split router', () => {
);
});
- it('writes search as a new entry or in place', () => {
+ it('writes search as a new entry or in place', async () => {
const { router, history, pane } = track(setup('/drive'));
const first = router.entry(pane(0))!.id;
- router.updateSearch(
+ await router.updateSearch(
pane(0),
'drive',
{ sort: ['name'] },
@@ -849,7 +850,7 @@ describe('split router', () => {
expect(history.read().search).toBe('?s0.drive.sort=name');
expect(history.entries()).toHaveLength(1);
- router.updateSearch(pane(0), 'drive', { sort: ['date'] });
+ await router.updateSearch(pane(0), 'drive', { sort: ['date'] });
expect(router.entry(pane(0))!.id).not.toBe(first);
expect(history.entries()).toHaveLength(2);
});
@@ -891,7 +892,7 @@ describe('split router', () => {
})
);
const { router, history, pane } = track(setup('/scheduling', { routes }));
- router.updateSearch(pane(0), 'scheduling', {
+ await router.updateSearch(pane(0), 'scheduling', {
tab: ['page'],
owner: ['me'],
});
@@ -922,10 +923,10 @@ describe('split router', () => {
expect(history.index()).toBe(0);
});
- it('jumps back to the nearest matching entry', () => {
+ it('jumps back to the nearest matching entry', async () => {
const { router, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/drive');
expect(
router.goBackTo(pane(0), (entry) => routeIds(entry)?.[0] === 'home')
).toBe(true);
@@ -935,8 +936,8 @@ describe('split router', () => {
it('removing entries cancels a pending traversal in that pane', async () => {
const { router, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/drive');
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, never);
const back = router.navigatePane(pane(0), -1);
expect(routeIds(router.pending(pane(0))?.to)).toEqual(['mail']);
@@ -950,10 +951,10 @@ describe('split router', () => {
expect(router.removeEntries(pane(0), isMail)).toBe(false);
});
- it('rewrites the current entry in place', () => {
+ it('rewrites the current entry in place', async () => {
const { router, history, pane } = track(setup('/md/draft'));
const id = router.entry(pane(0))!.id;
- router.rewriteCurrent(pane(0), '/md/real');
+ await router.rewriteCurrent(pane(0), '/md/real');
expect(router.entry(pane(0))!.id).toBe(id);
expect(history.read().path).toBe('/md/real');
expect(history.entries()).toHaveLength(1);
@@ -973,7 +974,9 @@ describe('split router while other work is in flight', () => {
const showsDrive = routeIds(router.entry(pane(0)))?.[0] === 'drive';
if (!showsDrive) return;
- untrack(() => router.navigatePane(pane(0), '/mail', { replace: true }));
+ void untrack(() =>
+ router.navigatePane(pane(0), '/mail', { replace: true })
+ );
});
return dispose;
@@ -1029,8 +1032,8 @@ describe('split router while other work is in flight', () => {
it('puts the URL back past every Back that a refused Back replaced', async () => {
const { router, history, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/drive');
const answers: ((allowed: boolean) => void)[] = [];
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, ({ cause }) => {
if (cause !== 'external') return true;
@@ -1107,10 +1110,11 @@ describe('split router while other work is in flight', () => {
await router.settled();
const sorting = router.updateSearch(pane(0), 'drive', { sort: ['date'] });
- router.navigatePane(pane(1), '/drive/md/d1');
+ const navigated = router.navigatePane(pane(1), '/drive/md/d1');
release();
await expect(sorting).resolves.toMatchObject({ status: 'committed' });
+ await navigated;
expect(router.entry(pane(0))?.location.search).toEqual({
drive: { sort: ['date'] },
});
@@ -1185,7 +1189,7 @@ describe('split router while other work is in flight', () => {
const { router, pane } = track(
setup('/home', {}, createTestPolicy({ closeLast }))
);
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/drive');
router.registerGuard(
pane(0),
PANE_ROUTE_LEVEL,
@@ -1224,13 +1228,15 @@ describe('split router while other work is in flight', () => {
const showsDrive = routeIds(router.entry(pane(0)))?.[0] === 'drive';
if (!showsDrive) return;
- untrack(() => router.navigatePane(pane(1), '/mail', { replace: true }));
+ void untrack(() =>
+ router.navigatePane(pane(1), '/mail', { replace: true })
+ );
});
return dispose;
});
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/drive');
await router.settled();
stopRedirecting();
@@ -1242,7 +1248,7 @@ describe('split router while other work is in flight', () => {
it('keeps a Back whose view redirects in place as it mounts', async () => {
const { router, history, pane } = track(setup('/drive'));
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
let armed = false;
const stopRedirecting = createRoot((dispose) => {
createEffect(() => {
@@ -1250,7 +1256,9 @@ describe('split router while other work is in flight', () => {
const redirects = armed && showsDrive;
if (!redirects) return;
- untrack(() => router.navigatePane(pane(0), '/home', { replace: true }));
+ void untrack(() =>
+ router.navigatePane(pane(0), '/home', { replace: true })
+ );
});
return dispose;
@@ -1303,8 +1311,8 @@ describe('split router while other work is in flight', () => {
it('settles a URL navigation that arrives while an earlier one is being put back', async () => {
const { history, adapter, landAll } = slowRevertHistory('/home');
const { router, pane } = track(setup('/home', { history: adapter }));
- router.navigatePane(pane(0), '/mail');
- router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/drive');
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, ({ cause }) =>
cause === 'external' ? never() : true
);
@@ -1323,9 +1331,9 @@ describe('split router while other work is in flight', () => {
it('puts back a Back that arrives while others are put back before them', async () => {
const { history, adapter, landAll } = slowRevertHistory('/home');
const { router, pane } = track(setup('/home', { history: adapter }));
- router.navigatePane(pane(0), '/mail');
- router.navigatePane(pane(0), '/drive');
- router.navigatePane(pane(0), '/md/d1');
+ await router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/drive');
+ await router.navigatePane(pane(0), '/md/d1');
let refuse: () => void = () => {};
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, ({ cause }) => {
if (cause !== 'external') return true;
@@ -1360,7 +1368,7 @@ describe('split router while other work is in flight', () => {
it('checks again before running a waiting action that a new Back overtook', async () => {
const { router, history, pane, paneStore } = track(setup('/home'));
- router.navigatePane(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
let allow: (allowed: boolean) => void = () => {};
router.registerGuard(pane(0), PANE_ROUTE_LEVEL, ({ cause }) => {
if (cause !== 'external') return true;
@@ -1377,7 +1385,7 @@ describe('split router while other work is in flight', () => {
if (!redirects) return;
redirected = true;
- untrack(() =>
+ void untrack(() =>
router.navigatePane(pane(0), '/drive/folder/f1', { replace: true })
);
});
@@ -1385,12 +1393,13 @@ describe('split router while other work is in flight', () => {
return dispose;
});
- router.navigatePane(pane(0), '/drive');
+ const navigated = router.navigatePane(pane(0), '/drive');
history.back();
await Promise.resolve();
await Promise.resolve();
allow(true);
await router.settled();
+ await navigated;
stopRedirecting();
expect(routeIds(router.entry(pane(0)))).toEqual(['drive', 'drive-folder']);
@@ -1399,7 +1408,7 @@ describe('split router while other work is in flight', () => {
expect(paneStore.read(pane(0))?.index).toBe(2);
});
- it('writes the URL again after the history adapter failed to write it', () => {
+ it('writes the URL again after the history adapter failed to write it', async () => {
vi.spyOn(console, 'error').mockImplementation(() => {});
const history = createMemoryHistory('/home');
let failNext = false;
@@ -1417,8 +1426,8 @@ describe('split router while other work is in flight', () => {
const { router, pane } = track(setup('/home', { history: flaky }));
failNext = true;
- router.navigatePane(pane(0), '/mail');
- router.rewriteCurrent(pane(0), '/mail');
+ await router.navigatePane(pane(0), '/mail');
+ await router.rewriteCurrent(pane(0), '/mail');
expect(history.read().path).toBe('/mail');
});
@@ -1434,12 +1443,12 @@ describe('split router while other work is in flight', () => {
expect(routeIds(router.entry(router.panes()[0]!))).toEqual(['mail']);
});
- it('drops a URL write still queued when the router is disposed', () => {
+ it('drops a URL write still queued when the router is disposed', async () => {
vi.useFakeTimers();
const { router, solid, dispose } = setupSolid('/app/home');
vi.runAllTimers();
- router.navigatePane(router.panes()[0]!, '/mail');
+ await router.navigatePane(router.panes()[0]!, '/mail');
dispose();
vi.runAllTimers();
@@ -1462,21 +1471,21 @@ describe('split router while other work is in flight', () => {
expect(solid.landed()).toBe('/settings');
});
- it('drops a queued write when a navigation leaves the router’s routes', () => {
+ it('drops a queued write when a navigation leaves the router’s routes', async () => {
vi.useFakeTimers();
const { router, solid } = track(setupSolid('/app/home'));
vi.runAllTimers();
- router.navigatePane(router.panes()[0]!, '/mail');
+ await router.navigatePane(router.panes()[0]!, '/mail');
expect(solid.leave('/settings').defaultPrevented).toBe(false);
vi.runAllTimers();
expect(solid.calls.map(([to]) => to)).toEqual(['/home']);
});
- it('moves the cursor on Back to an entry that looks like the current one', () => {
+ it('moves the cursor on Back to an entry that looks like the current one', async () => {
const { router, history, paneStore, pane } = track(setup('/home'));
- router.navigatePane(pane(0), '/home', { props: { note: 1 } });
+ await router.navigatePane(pane(0), '/home', { props: { note: 1 } });
expect(paneStore.read(pane(0))?.entries).toHaveLength(2);
history.back();
diff --git a/apps/web/src/lib/split-router/tests/solid.test.tsx b/apps/web/src/lib/split-router/tests/solid.test.tsx
index 9754af7880..20f0a1dce3 100644
--- a/apps/web/src/lib/split-router/tests/solid.test.tsx
+++ b/apps/web/src/lib/split-router/tests/solid.test.tsx
@@ -276,21 +276,21 @@ it('opts a mounted view into leave guards for its search namespace', () => {
expect(screen.getByRole('button', { name: 'sort:date' })).toBeTruthy();
});
describe('split router Solid bindings', () => {
- it('keeps a view mounted while its remount key holds and updates params in place', () => {
+ it('keeps a view mounted while its remount key holds and updates params in place', async () => {
const { router } = renderPanes('/drive/md/d1');
const pane = router.panes()[0]!;
expect(screen.getByTestId('document').textContent).toBe('md:d1');
- router.navigatePane(pane, '/drive/md/d2');
+ await router.navigatePane(pane, '/drive/md/d2');
expect(screen.getByTestId('document').textContent).toBe('md:d2');
expect(counts).toEqual({ drive: 1, document: 1 });
expect(documentTypeReads).toHaveBeenCalledTimes(1);
- router.navigatePane(pane, '/drive/pdf/d2');
+ await router.navigatePane(pane, '/drive/pdf/d2');
expect(counts).toEqual({ drive: 1, document: 2 });
});
- it('lets panel chrome around a prop-less outlet use the hooks', () => {
+ it('lets panel chrome around a prop-less outlet use the hooks', async () => {
const { router } = renderPanes('/drive/md/d1', (pane) => (
<Panel pane={pane} />
));
@@ -300,7 +300,7 @@ describe('split router Solid bindings', () => {
);
expect(screen.getByTestId('document').textContent).toBe('md:d1');
- router.navigatePane(pane, '/home');
+ await router.navigatePane(pane, '/home');
expect(screen.getByTestId('header').textContent).toBe('app/home back:true');
expect(screen.getByText('home')).toBeTruthy();
});
@@ -396,16 +396,16 @@ describe('split router Solid bindings', () => {
expect(screen.getByTestId('document').textContent).toBe('md:d3');
});
- it('runs leave guards before unmounting a view but not for search changes', () => {
+ it('runs leave guards before unmounting a view but not for search changes', async () => {
const { router, history } = renderPanes('/guarded');
const pane = router.panes()[0]!;
allowLeave = false;
- router.navigatePane(pane, '/home');
+ await router.navigatePane(pane, '/home');
expect(screen.getByTestId('guarded')).toBeTruthy();
- router.updateSearch(pane, 'anything', { x: ['1'] });
+ await router.updateSearch(pane, 'anything', { x: ['1'] });
expect(history.read().search).toBe('?s0.anything.x=1');
allowLeave = true;
- router.navigatePane(pane, '/home');
+ await router.navigatePane(pane, '/home');
expect(screen.queryByTestId('guarded')).toBeNull();
});
diff --git a/apps/web/src/lib/tauri/TauriProvider.tsx b/apps/web/src/lib/tauri/TauriProvider.tsx
index 266997537f..841c5367be 100644
--- a/apps/web/src/lib/tauri/TauriProvider.tsx
+++ b/apps/web/src/lib/tauri/TauriProvider.tsx
@@ -4,6 +4,7 @@ import { useAndroidBack } from '@core/mobile/androidBack';
import { useAndroidWindowInsets } from '@core/mobile/androidWindowInsets';
import { NativeAppUpdateRequiredDialog } from '@core/mobile/NativeAppUpdateRequiredDialog';
import { isPlatform, isTauri } from '@core/util/platform';
+import { Telemetry } from '@macro-inc/observability';
import { PlatformNotificationProvider } from '@notifications';
import { queryPersistence } from '@queries/client';
import type { RouteSectionProps } from '@solidjs/router';
@@ -132,11 +133,15 @@ function TauriProvider(props: { children: JSX.Element }) {
);
}
// Fetch current status since events emitted before the listener registered are missed
- invoke<BundleUpdateStatus>('get_bundle_update_status').then((status) => {
- setBundleUpdateStatus(status);
- });
+ invoke<BundleUpdateStatus>('get_bundle_update_status')
+ .then((status) => {
+ setBundleUpdateStatus(status);
+ })
+ .catch((error) => Telemetry.error(error, { surface: 'bundle-update' }));
onCleanup(() => {
- unlistenPromise.then((unlisten) => unlisten());
+ unlistenPromise
+ .then((unlisten) => unlisten())
+ .catch((error) => Telemetry.error(error, { surface: 'bundle-update' }));
});
document.body.classList.add('tauri');
diff --git a/apps/web/src/lib/tauri/navigation.ts b/apps/web/src/lib/tauri/navigation.ts
index 3aef0b4518..9ec57c5a42 100644
--- a/apps/web/src/lib/tauri/navigation.ts
+++ b/apps/web/src/lib/tauri/navigation.ts
@@ -1,5 +1,6 @@
import { getNativeMobilePlatform } from '@core/util/platform';
import { setPostLoginRedirect } from '@core/util/postLoginRedirect';
+import { Telemetry } from '@macro-inc/observability';
import { useNavigate } from '@solidjs/router';
import { invoke } from '@tauri-apps/api/core';
import { listen } from '@tauri-apps/api/event';
@@ -50,7 +51,9 @@ export function useTauriNavigationEffect() {
console.error('failed to flush launch deep link', e);
});
}
- inner();
+ inner().catch((error) =>
+ Telemetry.error(error, { surface: 'tauri-navigation' })
+ );
return onCleanup(() => {
unregisterInterceptor();
diff --git a/apps/web/src/lib/utils/handleFileUpload.ts b/apps/web/src/lib/utils/handleFileUpload.ts
index 9bd77b7875..81d2d21a8f 100644
--- a/apps/web/src/lib/utils/handleFileUpload.ts
+++ b/apps/web/src/lib/utils/handleFileUpload.ts
@@ -2,6 +2,7 @@ import { useSplitLayout } from '@components/app/split-layout/layout';
import { toast } from '@core/component/Toast/Toast';
import { fileTypeToBlockName } from '@core/constant/allBlocks';
import { type UploadInput, uploadFiles } from '@core/util/upload';
+import { Telemetry } from '@macro-inc/observability';
import { refetchHistory } from '@queries/history/history';
import { refetchSoupEntity } from '@queries/soup/cache';
@@ -27,11 +28,13 @@ export function useHandleFileUpload(options: { projectId?: string } = {}) {
// Refetch soup for folders once pending uploads are done, and show a success
// toast with an action to open the created folder/project.
for (const upload of pendingUploads) {
- upload.projectId.then((createdProjectId) => {
+ void upload.projectId.then((createdProjectId) => {
if (!createdProjectId) return;
- refetchSoupEntity(createdProjectId, 'project', { includeRoot: true });
- refetchHistory();
+ refetchSoupEntity(createdProjectId, 'project', {
+ includeRoot: true,
+ }).catch((error) => Telemetry.error(error, { surface: 'file-upload' }));
+ void refetchHistory();
toast.success(`Uploaded ${upload.name}`, {
actions: [
@@ -52,7 +55,9 @@ export function useHandleFileUpload(options: { projectId?: string } = {}) {
// refetch soup for uploaded docs
for (const upload of successfulUploads) {
if (upload.type === 'document') {
- refetchSoupEntity(upload.documentId, 'document');
+ refetchSoupEntity(upload.documentId, 'document').catch((error) =>
+ Telemetry.error(error, { surface: 'file-upload' })
+ );
}
}
diff --git a/apps/web/src/lib/workers/folder-upload/zip-worker.js b/apps/web/src/lib/workers/folder-upload/zip-worker.js
index 62622496e4..8a45602128 100644
--- a/apps/web/src/lib/workers/folder-upload/zip-worker.js
+++ b/apps/web/src/lib/workers/folder-upload/zip-worker.js
@@ -12,7 +12,7 @@ self.onmessage = function (event) {
},
});
- zipFiles(taskId, files, fileDetails, folderPaths ?? []);
+ void zipFiles(taskId, files, fileDetails, folderPaths ?? []);
}
};
diff --git a/apps/web/src/routes/Root.tsx b/apps/web/src/routes/Root.tsx
index b47dcd3d58..67dcde4d82 100644
--- a/apps/web/src/routes/Root.tsx
+++ b/apps/web/src/routes/Root.tsx
@@ -211,7 +211,7 @@ export function Root() {
createEffect(() => {
const cleanup = licenseChannel.subscribe(() => {
- invalidateUserInfo();
+ void invalidateUserInfo();
});
onCleanup(() => cleanup());
diff --git a/apps/web/tests/native/android/smoke.mjs b/apps/web/tests/native/android/smoke.mjs
index d46621ff8d..2685e505dd 100644
--- a/apps/web/tests/native/android/smoke.mjs
+++ b/apps/web/tests/native/android/smoke.mjs
@@ -430,7 +430,7 @@ try {
results.nativeUpload = { exactBytes: true, checksumHeader: true };
console.log('Native streaming PUT and checksum passed');
} finally {
- receiver.stop(true);
+ await receiver.stop(true);
}
assert.equal((await pendingShares())[0].token, first[0].token);
await adbRun(
diff --git a/apps/web/vite.base.ts b/apps/web/vite.base.ts
index a84e72d69d..a7ce1b0807 100644
--- a/apps/web/vite.base.ts
+++ b/apps/web/vite.base.ts
@@ -56,15 +56,19 @@ function gitBranchHmrPlugin(): Plugin {
return;
}
const headPath = resolve(gitDir, 'HEAD');
- const emit = () => {
- readGitBranchAsync().then((branch) => {
- server.ws.send({
- type: 'custom',
- event: 'git-branch:update',
- data: branch,
- });
+ const sendBranch = async () => {
+ const branch = await readGitBranchAsync();
+ server.ws.send({
+ type: 'custom',
+ event: 'git-branch:update',
+ data: branch,
});
};
+ const emit = () => {
+ sendBranch().catch((error) =>
+ server.config.logger.error(`git-branch-hmr: ${String(error)}`)
+ );
+ };
watchFile(headPath, { interval: 100 }, emit);
server.ws.on('connection', emit);
server.httpServer?.once('close', () => unwatchFile(headPath));