Skip to content

Commit 7589929

Browse files
🔇(frontend) drop debug console logs from chat layer
Remove leftover console.log statements from the driver resolution, Matrix driver, chat connection query and auth bootstrap.
1 parent 4ad3118 commit 7589929

4 files changed

Lines changed: 3 additions & 23 deletions

File tree

‎src/frontend/apps/hub/src/features/auth/Auth.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export const Auth = ({ children }: PropsWithChildren) => {
4747
// Backend-agnostic chat connection: the driver owns the handshake, the UI
4848
// only observes a generic aggregate status.
4949
const { status: chatStatus, chatUser, redirectTo } = useChatConnections(user);
50-
console.log("chatStatus", chatStatus, chatUser, redirectTo);
5150

5251
const init = async () => {
5352
try {

‎src/frontend/apps/hub/src/features/chat/hooks/useChatConnection.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ export const useChatConnections = (
2525
return useQueries({
2626
queries: entries.map((entry) => ({
2727
queryKey: chatKeys.connection(entry.accountId, userId),
28-
queryFn: async () => {
29-
console.log("entry", entry);
30-
const a = await entry.driver.connect(user);
31-
console.log("a", a);
32-
return a;
33-
},
28+
queryFn: () => entry.driver.connect(user),
3429
enabled: user !== undefined && user !== null,
3530
staleTime: Infinity,
3631
meta: { noGlobalError: true },

‎src/frontend/apps/hub/src/features/config/Config.ts‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,20 @@ import type { AccountId, DriverKind } from "../drivers/types";
99
* Account manifests can override this per account.
1010
*/
1111
export const resolveDriverKind = (): DriverKind => {
12-
console.log("resolveDriverKind");
1312
if (typeof window !== "undefined") {
1413
const param = new URLSearchParams(window.location.search).get("driver");
1514
if (param === "matrix" || param === "mock") {
16-
const driver = param;
17-
console.log("driver A", driver);
18-
return driver;
15+
return param;
1916
}
2017
}
21-
const driver =
22-
process.env.NEXT_PUBLIC_CHAT_DRIVER === "matrix" ? "matrix" : "mock";
23-
console.log("driver B", driver);
24-
return driver;
18+
return process.env.NEXT_PUBLIC_CHAT_DRIVER === "matrix" ? "matrix" : "mock";
2519
};
2620

2721
export const createDriver = (
2822
kind: DriverKind,
2923
accountId: AccountId,
3024
settings: Record<string, unknown> = {},
3125
): Driver => {
32-
console.log("createDriver", kind);
3326
if (kind === "matrix") {
3427
return new MatrixDriver(accountId, settings);
3528
}

‎src/frontend/apps/hub/src/features/drivers/implementations/MatrixDriver.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,11 @@ export class MatrixDriver extends MockDriver {
226226
// exposes a conversation-list endpoint. The driver returns account-local
227227
// chats; hooks decorate them with the global account identity.
228228
const matrixChats = this.mx?.getVisibleRooms() ?? [];
229-
console.log("matrixChats", matrixChats);
230229
const currentUserId = this.mx?.getUserId() ?? undefined;
231230
const localChats = matrixChats.map((room) =>
232231
matrixRoomToLocalChat(room, currentUserId),
233232
);
234233

235-
console.log("localChats", localChats);
236234
return {
237235
favourites: [],
238236
all: localChats,
@@ -309,9 +307,6 @@ export class MatrixDriver extends MockDriver {
309307
const authors = buildAuthors(room, pageEvents, selfUserId);
310308
const nextCursor =
311309
startIndex === 0 && reachedStart ? null : (messages[0]?.id ?? null);
312-
console.log("messages", messages);
313-
console.log("authors", authors);
314-
console.log("nextCursor", nextCursor);
315310
return { messages, authors, nextCursor };
316311
}
317312

@@ -321,7 +316,6 @@ export class MatrixDriver extends MockDriver {
321316
* caching and de-duplication are handled by React Query — no bespoke store.
322317
*/
323318
async connect(user: User | null | undefined): Promise<ChatConnectionState> {
324-
console.log("connect");
325319
// The whole flow touches window/localStorage/IndexedDB. Static export has
326320
// no server runtime, but guard regardless.
327321
if (typeof window === "undefined") {
@@ -339,7 +333,6 @@ export class MatrixDriver extends MockDriver {
339333
const params = new URLSearchParams(window.location.search);
340334
const code = params.get("code");
341335
const state = params.get("state");
342-
console.log("code", code);
343336
if (code && state) {
344337
if (sessionStorage.getItem(this.key(STORAGE.oidcState)) !== state) {
345338
return { status: "idle", chatUser: null };

0 commit comments

Comments
 (0)