diff --git a/backend/src/apis/openai/OpenaiClient.ts b/backend/src/apis/openai/OpenaiClient.ts index eb37a04f8..5655020aa 100644 --- a/backend/src/apis/openai/OpenaiClient.ts +++ b/backend/src/apis/openai/OpenaiClient.ts @@ -92,6 +92,7 @@ export class OpenaiClient { if (openaiThreadEntity.updatedAt < new Date(Date.now() - OPENAI_AI_THREAD_DEFAULT_TIMEOUT_DAYS * 24 * 60 * 60 * 1000)) { logger.info(`Openai thread for user: ${user.id} is older than ${OPENAI_AI_THREAD_DEFAULT_TIMEOUT_DAYS} days, deleting...`) // let run async, because it could need some time, but we don't need to wait, because we create a new one nevertheless + // biome-ignore lint/complexity/noVoid: start it intentionally async without waiting for result void this.deleteThread(openaiThreadEntity.id) return [] } diff --git a/backend/src/graphql/resolver/TransactionResolver.test.ts b/backend/src/graphql/resolver/TransactionResolver.test.ts index 774502b28..636c4d63f 100644 --- a/backend/src/graphql/resolver/TransactionResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionResolver.test.ts @@ -73,7 +73,6 @@ let peter: User let homeCom: DbCommunity let foreignCom: DbCommunity -let fedForeignCom: DbFederatedCommunity describe('send coins', () => { beforeAll(async () => { diff --git a/backend/src/seeds/factory/user.ts b/backend/src/seeds/factory/user.ts index 44db02c8f..36d9adfeb 100644 --- a/backend/src/seeds/factory/user.ts +++ b/backend/src/seeds/factory/user.ts @@ -18,7 +18,6 @@ export const userFactory = async ( // console.log('call createUser with', JSON.stringify(user, null, 2)) const response = await mutate({ mutation: createUser, variables: user }) if (!response?.data?.createUser) { - // biome-ignore lint/suspicious/noConsole: will be used in tests where logging is mocked // console.log(JSON.stringify(response, null, 2)) throw new Error('createUser mutation returned unexpected response') } diff --git a/config-schema/src/validate.ts b/config-schema/src/validate.ts index 83cf097b3..17ccea483 100644 --- a/config-schema/src/validate.ts +++ b/config-schema/src/validate.ts @@ -31,6 +31,7 @@ export function validate(schema: ObjectSchema, data: any) { ) } } catch (e) { + // biome-ignore lint/suspicious/noConsole: schema validation may be run before logger is initialized console.error('Error getting description for key ' + key + ': ' + e) throw e } diff --git a/core/src/graphql/logic/storeLinkAsRedeemed.ts b/core/src/graphql/logic/storeLinkAsRedeemed.ts index cccc97d50..efc3589de 100644 --- a/core/src/graphql/logic/storeLinkAsRedeemed.ts +++ b/core/src/graphql/logic/storeLinkAsRedeemed.ts @@ -1,4 +1,8 @@ -import { TransactionLink as DbTransactionLink, User as DbUser } from "database"; +import { TransactionLink as DbTransactionLink, User as DbUser } from 'database' +import { getLogger } from 'log4js' +import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const' + +const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.logic.storeLinkAsRedeemed`) export async function storeLinkAsRedeemed( dbTransactionLink: DbTransactionLink, @@ -11,7 +15,7 @@ export async function storeLinkAsRedeemed( await DbTransactionLink.save(dbTransactionLink) return true } catch (err) { - console.error('error in storeLinkAsRedeemed;', err) + logger.error('error: ', err) return false } } \ No newline at end of file diff --git a/core/src/types/images.d.ts b/core/src/types/images.d.ts index ef7006d32..91c6fd6f9 100644 --- a/core/src/types/images.d.ts +++ b/core/src/types/images.d.ts @@ -1,3 +1,4 @@ +// biome-ignore lint/style/noDefaultExport: Asset modules use default export by convention declare module '*.jpg' { const value: string export default value diff --git a/database/src/queries/communityHandshakes.test.ts b/database/src/queries/communityHandshakes.test.ts index 09937cc66..c1b665bab 100644 --- a/database/src/queries/communityHandshakes.test.ts +++ b/database/src/queries/communityHandshakes.test.ts @@ -58,7 +58,6 @@ describe('communityHandshakes', () => { communityHandshakeState!.status = CommunityHandshakeStateType.START_OPEN_CONNECTION_CALLBACK await communityHandshakeState!.save() const communityHandshakeState2 = await findPendingCommunityHandshake(publicKey, '1_0') - const states = await DbCommunityHandshakeState.find() expect(communityHandshakeState2).toBeDefined() expect(communityHandshakeState2).toMatchObject({ publicKey: publicKey.asBuffer(), diff --git a/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts b/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts index d22c816ff..3bee91e3e 100644 --- a/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts +++ b/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts @@ -62,6 +62,7 @@ export class AuthenticationResolver { // no await to respond immediately and invoke callback-request asynchronously // important: startOpenConnectionCallback must catch all exceptions them self, or server will crash! + // biome-ignore lint/complexity/noVoid: start it intentionally async without waiting for result void startOpenConnectionCallback(args.handshakeID, argsPublicKey, fedComA) methodLogger.debug('openConnection() successfully initiated callback and returns true immediately...') return true @@ -96,6 +97,7 @@ export class AuthenticationResolver { `found fedComB and start authentication: ${fedComB.endPoint}${fedComB.apiVersion}`, ) // no await to respond immediately and invoke authenticate-request asynchronously + // biome-ignore lint/complexity/noVoid: start it intentionally async without waiting for result void startAuthentication(args.handshakeID, openConnectionCallbackJwtPayload.oneTimeCode, fedComB) // methodLogger.debug('openConnectionCallback() successfully initiated authentication and returns true immediately...') return true diff --git a/federation/src/server/cors.ts b/federation/src/server/cors.ts index 873d6a2eb..95663695d 100644 --- a/federation/src/server/cors.ts +++ b/federation/src/server/cors.ts @@ -1,9 +1,8 @@ -import cors from 'cors' +import corsLib from 'cors' const corsOptions = { origin: '*', exposedHeaders: ['token'], } -// biome-ignore lint/style/noDefaultExport: -export default cors(corsOptions) +export const cors = corsLib(corsOptions) diff --git a/shared/src/helper/onShutdown.ts b/shared/src/helper/onShutdown.ts index a27c931a6..ea24bf2fc 100644 --- a/shared/src/helper/onShutdown.ts +++ b/shared/src/helper/onShutdown.ts @@ -1,4 +1,3 @@ -import { Logger } from 'log4js' import colors from 'yoctocolors-cjs' export enum ShutdownReason { @@ -44,8 +43,10 @@ export function onShutdown(shutdownHandler: (reason: ShutdownReason, error?: Err } export function printServerCrashAsciiArt(msg1: string, msg2: string, msg3: string) { + // biome-ignore-start lint/suspicious/noConsole: Server Crash Ascii Art is for console and stdout console.error(colors.redBright(` /\\_/\\ ${msg1}`)) console.error(colors.redBright(`( x.x ) ${msg2}`)) console.error(colors.redBright(` > < ${msg3}`)) console.error(colors.redBright('')) + // biome-ignore-end lint/suspicious/noConsole: Server Crash Ascii Art is for console and stdout } \ No newline at end of file