diff --git a/backend/api/src/app.ts b/backend/api/src/app.ts index 4175e563..e7ab2ba6 100644 --- a/backend/api/src/app.ts +++ b/backend/api/src/app.ts @@ -191,7 +191,7 @@ Object.entries(handlers).forEach(([path, handler]) => { } }) -// console.log('COMPASS_API_KEY:', process.env.COMPASS_API_KEY) +// console.debug('COMPASS_API_KEY:', process.env.COMPASS_API_KEY) // Internal Endpoints app.post(pathWithPrefix("/internal/send-search-notifications"), diff --git a/backend/api/src/create-profile.ts b/backend/api/src/create-profile.ts index 94b27535..ae4f379b 100644 --- a/backend/api/src/create-profile.ts +++ b/backend/api/src/create-profile.ts @@ -29,7 +29,7 @@ export const createProfile: APIHandler<'create-profile'> = async (body, auth) => updateUser(pg, auth.uid, { avatarUrl: body.pinned_url }) } - console.log('body', body) + console.debug('body', body) const { data, error } = await tryCatch( insert(pg, 'profiles', { user_id: auth.uid, ...body }) @@ -46,7 +46,7 @@ export const createProfile: APIHandler<'create-profile'> = async (body, auth) => try { await track(auth.uid, 'create profile', {username: user.username}) } catch (e) { - console.log('Failed to track create profile', e) + console.error('Failed to track create profile', e) } try { await sendDiscordMessage( @@ -54,7 +54,7 @@ export const createProfile: APIHandler<'create-profile'> = async (body, auth) => 'members', ) } catch (e) { - console.log('Failed to send discord new profile', e) + console.error('Failed to send discord new profile', e) } try { const nProfiles = await pg.one( @@ -69,7 +69,7 @@ export const createProfile: APIHandler<'create-profile'> = async (body, auth) => n % 50 === 0 ) } - console.log(nProfiles, isMilestone(nProfiles)) + console.debug(nProfiles, isMilestone(nProfiles)) if (isMilestone(nProfiles)) { await sendDiscordMessage( `We just reached **${nProfiles}** total profiles! 🎉`, @@ -78,7 +78,7 @@ export const createProfile: APIHandler<'create-profile'> = async (body, auth) => } } catch (e) { - console.log('Failed to send discord user milestone', e) + console.error('Failed to send discord user milestone', e) } } diff --git a/backend/api/src/create-user.ts b/backend/api/src/create-user.ts index 4f18fe10..389a2207 100644 --- a/backend/api/src/create-user.ts +++ b/backend/api/src/create-user.ts @@ -127,12 +127,12 @@ export const createUser: APIHandler<'create-user'> = async ( try { await track(auth.uid, 'create profile', {username: user.username}) } catch (e) { - console.log('Failed to track create profile', e) + console.error('Failed to track create profile', e) } try { await sendWelcomeEmail(user, privateUser) } catch (e) { - console.log('Failed to sendWelcomeEmail', e) + console.error('Failed to sendWelcomeEmail', e) } } diff --git a/backend/api/src/delete-me.ts b/backend/api/src/delete-me.ts index c35930e0..b95e5a88 100644 --- a/backend/api/src/delete-me.ts +++ b/backend/api/src/delete-me.ts @@ -35,7 +35,7 @@ export const deleteMe: APIHandler<'me/delete'> = async (body, auth) => { try { const auth = admin.auth() await auth.deleteUser(userId) - console.log(`Deleted user ${userId} from Firebase Auth and Supabase`) + console.debug(`Deleted user ${userId} from Firebase Auth and Supabase`) } catch (e) { console.error('Error deleting user from Firebase Auth:', e) } diff --git a/backend/api/src/get-compatibililty-questions.ts b/backend/api/src/get-compatibililty-questions.ts index 5ad862af..5fd1f8c0 100644 --- a/backend/api/src/get-compatibililty-questions.ts +++ b/backend/api/src/get-compatibililty-questions.ts @@ -39,7 +39,7 @@ export const getCompatibilityQuestions: APIHandler< const questions = shuffle(dbQuestions) - // console.log( + // console.debug( // 'got questions', // questions.map((q) => q.question + ' ' + q.score) // ) diff --git a/backend/api/src/get-profiles.ts b/backend/api/src/get-profiles.ts index 72022ca7..ae131b33 100644 --- a/backend/api/src/get-profiles.ts +++ b/backend/api/src/get-profiles.ts @@ -29,7 +29,7 @@ export type profileQueryType = { export const loadProfiles = async (props: profileQueryType) => { const pg = createSupabaseDirectClient() - console.log(props) + console.debug(props) const { limit: limitParam, after, @@ -87,7 +87,7 @@ export const loadProfiles = async (props: profileQueryType) => { const cursor = after ? profiles.findIndex((l) => l.id.toString() === after) + 1 : 0 - console.log(cursor) + console.debug(cursor) if (limitParam) return profiles.slice(cursor, cursor + limitParam) @@ -158,7 +158,7 @@ export const loadProfiles = async (props: profileQueryType) => { limitParam && limit(limitParam) ) - // console.log('query:', query) + // console.debug('query:', query) return await pg.map(query, [], convertRow) } diff --git a/backend/api/src/junk-drawer/private-messages.ts b/backend/api/src/junk-drawer/private-messages.ts index 84bece65..3cf8496b 100644 --- a/backend/api/src/junk-drawer/private-messages.ts +++ b/backend/api/src/junk-drawer/private-messages.ts @@ -163,7 +163,7 @@ const notifyOtherUserInChannelIfInactive = async ( // TODO: notification only for active user const otherUser = await getUser(otherUserId.user_id) - console.log('otherUser:', otherUser) + console.debug('otherUser:', otherUser) if (!otherUser) return await createNewMessageNotification(creator, otherUser, channelId) @@ -175,7 +175,7 @@ const createNewMessageNotification = async ( channelId: number ) => { const privateUser = await getPrivateUser(toUser.id) - console.log('privateUser:', privateUser) + console.debug('privateUser:', privateUser) if (!privateUser) return await sendNewMessageEmail(privateUser, fromUser, toUser, channelId) } diff --git a/backend/api/src/send-search-notifications.ts b/backend/api/src/send-search-notifications.ts index 7fa077d1..17215f0e 100644 --- a/backend/api/src/send-search-notifications.ts +++ b/backend/api/src/send-search-notifications.ts @@ -25,7 +25,7 @@ export const sendSearchNotifications = async () => { from('bookmarked_searches'), ) const searches = await pg.map(search_query, [], convertSearchRow) as Row<'bookmarked_searches'>[] - console.log(`Running ${searches.length} bookmarked searches`) + console.debug(`Running ${searches.length} bookmarked searches`) const _users = await pg.map( renderSql( @@ -36,7 +36,7 @@ export const sendSearchNotifications = async () => { convertSearchRow ) as Row<'users'>[] const users = keyBy(_users, 'id') - console.log('users', users) + console.debug('users', users) const _privateUsers = await pg.map( renderSql( @@ -47,7 +47,7 @@ export const sendSearchNotifications = async () => { convertSearchRow ) as Row<'private_users'>[] const privateUsers = keyBy(_privateUsers, 'id') - console.log('privateUsers', privateUsers) + console.debug('privateUsers', privateUsers) const matches: MatchesByUserType = {} @@ -55,7 +55,7 @@ export const sendSearchNotifications = async () => { if (typeof row.search_filters !== 'object') continue; const props = {...row.search_filters, skipId: row.creator_id, lastModificationWithin: '24 hours'} const profiles = await loadProfiles(props as profileQueryType) - console.log(profiles.map((item: any) => item.name)) + console.debug(profiles.map((item: any) => item.name)) if (!profiles.length) continue if (!(row.creator_id in matches)) { if (!privateUsers[row.creator_id]) continue @@ -74,7 +74,7 @@ export const sendSearchNotifications = async () => { })), }) } - console.log('matches:', JSON.stringify(matches, null, 2)) + console.debug('matches:', JSON.stringify(matches, null, 2)) await notifyBookmarkedSearch(matches) return {status: 'success'} diff --git a/backend/email/emails/functions/send-email.ts b/backend/email/emails/functions/send-email.ts index 16529d31..e265df4b 100644 --- a/backend/email/emails/functions/send-email.ts +++ b/backend/email/emails/functions/send-email.ts @@ -17,7 +17,7 @@ export const sendEmail = async ( options?: CreateEmailRequestOptions ) => { const resend = getResend() - console.log(resend, payload, options) + console.debug(resend, payload, options) async function sendEmailThrottle(data: any, options: any) { if (!resend) return { data: null, error: 'No Resend client' } @@ -28,7 +28,7 @@ export const sendEmail = async ( { replyTo: 'Compass ', ...payload }, options ) - console.log('resend.emails.send', data, error) + console.debug('resend.emails.send', data, error) if (error) { log.error( @@ -47,12 +47,12 @@ const getResend = () => { if (resend) return resend if (!process.env.RESEND_KEY) { - console.log('No RESEND_KEY, skipping email send') + console.debug('No RESEND_KEY, skipping email send') return } const apiKey = process.env.RESEND_KEY as string - // console.log(`RESEND_KEY: ${apiKey}`) + // console.debug(`RESEND_KEY: ${apiKey}`) resend = new Resend(apiKey) return resend } diff --git a/backend/email/emails/functions/send-test-email.ts b/backend/email/emails/functions/send-test-email.ts index c4e81883..b54baa7a 100755 --- a/backend/email/emails/functions/send-test-email.ts +++ b/backend/email/emails/functions/send-test-email.ts @@ -4,11 +4,11 @@ if (require.main === module) { const email = process.argv[2] if (!email) { console.error('Please provide an email address') - console.log('Usage: ts-node send-test-email.ts your@email.com') + console.debug('Usage: ts-node send-test-email.ts your@email.com') process.exit(1) } sendTestEmail(email) - .then(() => console.log('Email sent successfully!')) + .then(() => console.debug('Email sent successfully!')) .catch((error) => console.error('Failed to send email:', error)) } \ No newline at end of file diff --git a/backend/scripts/2025-04-23-migrate-social-links.ts b/backend/scripts/2025-04-23-migrate-social-links.ts index d04a1a5f..225c24e8 100644 --- a/backend/scripts/2025-04-23-migrate-social-links.ts +++ b/backend/scripts/2025-04-23-migrate-social-links.ts @@ -36,7 +36,7 @@ runScript(async ({ pg }) => { } } - // console.log('updates', updates.slice(0, 10)) + // console.debug('updates', updates.slice(0, 10)) // return let count = 0 diff --git a/backend/scripts/find-tiptap-nodes.ts b/backend/scripts/find-tiptap-nodes.ts index 2f120e59..eaacc7d9 100644 --- a/backend/scripts/find-tiptap-nodes.ts +++ b/backend/scripts/find-tiptap-nodes.ts @@ -24,7 +24,7 @@ runScript(async ({ pg }) => { }) const getNodes = async (pg: SupabaseDirectClient, nodeName: string) => { - console.log(`\nSearching comments for ${nodeName}...`) + console.debug(`\nSearching comments for ${nodeName}...`) const commentQuery = renderSql( select('id, user_id, on_user_id, content'), from('profile_comments'), @@ -32,15 +32,15 @@ const getNodes = async (pg: SupabaseDirectClient, nodeName: string) => { ) const comments = await pg.manyOrNone(commentQuery) - console.log(`Found ${comments.length} comments:`) + console.debug(`Found ${comments.length} comments:`) comments.forEach((comment) => { - console.log('\nComment ID:', comment.id) - console.log('From user:', comment.user_id) - console.log('On user:', comment.on_user_id) - console.log('Content:', JSON.stringify(comment.content)) + console.debug('\nComment ID:', comment.id) + console.debug('From user:', comment.user_id) + console.debug('On user:', comment.on_user_id) + console.debug('Content:', JSON.stringify(comment.content)) }) - console.log(`\nSearching private messages for ${nodeName}...`) + console.debug(`\nSearching private messages for ${nodeName}...`) const messageQuery = renderSql( select('id, user_id, channel_id, content'), from('private_user_messages'), @@ -48,15 +48,15 @@ const getNodes = async (pg: SupabaseDirectClient, nodeName: string) => { ) const messages = await pg.manyOrNone(messageQuery) - console.log(`Found ${messages.length} private messages:`) + console.debug(`Found ${messages.length} private messages:`) messages.forEach((msg) => { - console.log('\nMessage ID:', msg.id) - console.log('From user:', msg.user_id) - console.log('Channel:', msg.channel_id) - console.log('Content:', JSON.stringify(msg.content)) + console.debug('\nMessage ID:', msg.id) + console.debug('From user:', msg.user_id) + console.debug('Channel:', msg.channel_id) + console.debug('Content:', JSON.stringify(msg.content)) }) - console.log(`\nSearching profiles for ${nodeName}...`) + console.debug(`\nSearching profiles for ${nodeName}...`) const users = renderSql( select('user_id, bio'), from('profiles'), @@ -64,9 +64,9 @@ const getNodes = async (pg: SupabaseDirectClient, nodeName: string) => { ) const usersWithMentions = await pg.manyOrNone(users) - console.log(`Found ${usersWithMentions.length} users:`) + console.debug(`Found ${usersWithMentions.length} users:`) usersWithMentions.forEach((user) => { - console.log('\nUser ID:', user.user_id) - console.log('Bio:', JSON.stringify(user.bio)) + console.debug('\nUser ID:', user.user_id) + console.debug('Bio:', JSON.stringify(user.bio)) }) } diff --git a/backend/scripts/regen-schema.ts b/backend/scripts/regen-schema.ts index 436efe52..3e1320ee 100644 --- a/backend/scripts/regen-schema.ts +++ b/backend/scripts/regen-schema.ts @@ -178,7 +178,7 @@ async function getTableInfo(pg: SupabaseDirectClient, tableName: string) { } async function getFunctions(pg: SupabaseDirectClient) { - console.log('Getting functions') + console.debug('Getting functions') const rows = await pg.manyOrNone<{ function_name: string definition: string @@ -196,7 +196,7 @@ async function getFunctions(pg: SupabaseDirectClient) { } async function getViews(pg: SupabaseDirectClient) { - console.log('Getting views') + console.debug('Getting views') return pg.manyOrNone<{ view_name: string; definition: string }>( `SELECT table_name AS view_name, @@ -214,7 +214,7 @@ async function generateSQLFiles(pg: SupabaseDirectClient) { (row) => row.tablename as string ) - console.log(`Getting info for ${tables.length} tables`) + console.debug(`Getting info for ${tables.length} tables`) const tableInfos = await Promise.all( tables.map((table) => getTableInfo(pg, table)) ) @@ -331,7 +331,7 @@ async function generateSQLFiles(pg: SupabaseDirectClient) { await fs.writeFile(`${outputDir}/${tableInfo.tableName}.sql`, content) } - console.log('Writing remaining functions to functions.sql') + console.debug('Writing remaining functions to functions.sql') let functionsContent = `-- This file is autogenerated from regen-schema.ts\n\n` for (const func of functions) { @@ -340,7 +340,7 @@ async function generateSQLFiles(pg: SupabaseDirectClient) { await fs.writeFile(`${outputDir}/functions.sql`, functionsContent) - console.log('Writing views to views.sql') + console.debug('Writing views to views.sql') let viewsContent = `-- This file is autogenerated from regen-schema.ts\n\n` for (const view of views) { @@ -350,7 +350,7 @@ async function generateSQLFiles(pg: SupabaseDirectClient) { await fs.writeFile(`${outputDir}/views.sql`, viewsContent) - console.log('Prettifying SQL files...') + console.debug('Prettifying SQL files...') execSync( `prettier --write ${outputDir}/*.sql --ignore-path ../supabase/.gitignore` ) diff --git a/backend/scripts/remove-tiptap-nodes.ts b/backend/scripts/remove-tiptap-nodes.ts index 24f3a5ad..8231d6c1 100644 --- a/backend/scripts/remove-tiptap-nodes.ts +++ b/backend/scripts/remove-tiptap-nodes.ts @@ -30,7 +30,7 @@ const removeNodesOfType = ( runScript(async ({ pg }) => { const nodeType = 'linkPreview' - console.log('\nSearching comments for linkPreviews...') + console.debug('\nSearching comments for linkPreviews...') const commentQuery = renderSql( select('id, content'), from('profile_comments'), @@ -38,21 +38,21 @@ runScript(async ({ pg }) => { ) const comments = await pg.manyOrNone(commentQuery) - console.log(`Found ${comments.length} comments with linkPreviews`) + console.debug(`Found ${comments.length} comments with linkPreviews`) for (const comment of comments) { const newContent = removeNodesOfType(comment.content, nodeType) - console.log('before', comment.content) - console.log('after', newContent) + console.debug('before', comment.content) + console.debug('after', newContent) await pg.none('update profile_comments set content = $1 where id = $2', [ newContent, comment.id, ]) - console.log('Updated comment:', comment.id) + console.debug('Updated comment:', comment.id) } - console.log('\nSearching private messages for linkPreviews...') + console.debug('\nSearching private messages for linkPreviews...') const messageQuery = renderSql( select('id, content'), from('private_user_messages'), @@ -60,17 +60,17 @@ runScript(async ({ pg }) => { ) const messages = await pg.manyOrNone(messageQuery) - console.log(`Found ${messages.length} messages with linkPreviews`) + console.debug(`Found ${messages.length} messages with linkPreviews`) for (const msg of messages) { const newContent = removeNodesOfType(msg.content, nodeType) - console.log('before', JSON.stringify(msg.content, null, 2)) - console.log('after', JSON.stringify(newContent, null, 2)) + console.debug('before', JSON.stringify(msg.content, null, 2)) + console.debug('after', JSON.stringify(newContent, null, 2)) await pg.none( 'update private_user_messages set content = $1 where id = $2', [newContent, msg.id] ) - console.log('Updated message:', msg.id) + console.debug('Updated message:', msg.id) } }) diff --git a/backend/shared/src/firebase-utils.ts b/backend/shared/src/firebase-utils.ts index 41290d96..5d9ebb33 100644 --- a/backend/shared/src/firebase-utils.ts +++ b/backend/shared/src/firebase-utils.ts @@ -5,7 +5,7 @@ import {ENV_CONFIG, getStorageBucketId} from "common/envs/constants"; export const getServiceAccountCredentials = () => { let keyPath = ENV_CONFIG.googleApplicationCredentials - // console.log('Using GOOGLE_APPLICATION_CREDENTIALS:', keyPath) + // console.debug('Using GOOGLE_APPLICATION_CREDENTIALS:', keyPath) if (!keyPath) { // throw new Error( // `Please set the GOOGLE_APPLICATION_CREDENTIALS environment variable to contain the path to your key file.` @@ -16,7 +16,7 @@ export const getServiceAccountCredentials = () => { if (!keyPath.startsWith('/')) { // Make relative paths relative to the current file keyPath = __dirname + '/' + keyPath - // console.log(keyPath) + // console.debug(keyPath) } try { @@ -41,11 +41,11 @@ export async function deleteUserFiles(username: string) { const [files] = await bucket.getFiles({prefix: path}); if (files.length === 0) { - console.log(`No files found in bucket for user ${username}`); + console.debug(`No files found in bucket for user ${username}`); return; } await Promise.all(files.map(file => file.delete())); - console.log(`Deleted ${files.length} files for user ${username}`); + console.debug(`Deleted ${files.length} files for user ${username}`); } \ No newline at end of file diff --git a/backend/shared/src/helpers/generate-and-update-avatar-urls.ts b/backend/shared/src/helpers/generate-and-update-avatar-urls.ts index 45007456..12582548 100644 --- a/backend/shared/src/helpers/generate-and-update-avatar-urls.ts +++ b/backend/shared/src/helpers/generate-and-update-avatar-urls.ts @@ -25,7 +25,7 @@ export const generateAvatarUrl = async ( const buffer = await res.arrayBuffer() return await upload(userId, Buffer.from(buffer), bucket) } catch (e) { - console.log('error generating avatar', e) + console.debug('error generating avatar', e) return `https://${DOMAIN}/images/default-avatar.png` } } diff --git a/backend/shared/src/helpers/search.ts b/backend/shared/src/helpers/search.ts index 4f32c15f..fdc08855 100644 --- a/backend/shared/src/helpers/search.ts +++ b/backend/shared/src/helpers/search.ts @@ -3,7 +3,7 @@ export const constructPrefixTsQuery = (term: string) => { .replace(/'/g, "''") .replace(/[!&|():*<>]/g, '') .trim() - console.log(`Term: "${sanitized}"`) + console.debug(`Term: "${sanitized}"`) if (sanitized === '') return '' const tokens = sanitized.split(/\s+/) return tokens.join(' & ') + ':*' diff --git a/backend/shared/src/init-admin.ts b/backend/shared/src/init-admin.ts index 61ee9bde..af1501d4 100644 --- a/backend/shared/src/init-admin.ts +++ b/backend/shared/src/init-admin.ts @@ -9,12 +9,12 @@ export const initAdmin = () => { if (IS_LOCAL) { try { const serviceAccount = getServiceAccountCredentials() - // console.log(serviceAccount) + // console.debug(serviceAccount) if (!serviceAccount.project_id) { - console.log(`GOOGLE_APPLICATION_CREDENTIALS not set, skipping admin firebase init.`) + console.debug(`GOOGLE_APPLICATION_CREDENTIALS not set, skipping admin firebase init.`) return } - console.log(`Initializing connection to ${serviceAccount.project_id} Firebase...`) + console.debug(`Initializing connection to ${serviceAccount.project_id} Firebase...`) return admin.initializeApp({ projectId: serviceAccount.project_id, credential: admin.credential.cert(serviceAccount), @@ -25,6 +25,6 @@ export const initAdmin = () => { } } - console.log(`Initializing connection to default Firebase...`) + console.debug(`Initializing connection to default Firebase...`) return admin.initializeApp() } diff --git a/backend/shared/src/monitoring/log.ts b/backend/shared/src/monitoring/log.ts index 2223683a..e833fa6d 100644 --- a/backend/shared/src/monitoring/log.ts +++ b/backend/shared/src/monitoring/log.ts @@ -79,7 +79,7 @@ function writeLog( // record error properties in GCP if you just do log(err) output['error'] = msg } - console.log(JSON.stringify(output, replacer)) + console.debug(JSON.stringify(output, replacer)) } else { const category = Object.values(pick(data, DISPLAY_CATEGORY_KEYS)).join() const categoryLabel = category ? dim(category) + ' ' : '' diff --git a/backend/shared/src/supabase/init.ts b/backend/shared/src/supabase/init.ts index 8e201be2..9db1c7d5 100644 --- a/backend/shared/src/supabase/init.ts +++ b/backend/shared/src/supabase/init.ts @@ -64,7 +64,7 @@ const newClient = ( ...settings, } - // console.log(config) + // console.debug(config) return pgp(config) } diff --git a/common/src/envs/constants.ts b/common/src/envs/constants.ts index 70ffd486..8d959fbb 100644 --- a/common/src/envs/constants.ts +++ b/common/src/envs/constants.ts @@ -26,7 +26,7 @@ export const IS_GOOGLE_CLOUD = !!process.env.GOOGLE_CLOUD_PROJECT export const IS_VERCEL = !!process.env.NEXT_PUBLIC_VERCEL export const IS_LOCAL = !IS_GOOGLE_CLOUD && !IS_VERCEL export const HOSTING_ENV = IS_GOOGLE_CLOUD ? 'Google Cloud' : IS_VERCEL ? 'Vercel' : IS_LOCAL ? 'local' : 'unknown' -console.log(`Running in ${HOSTING_ENV} (${ENV})`,); +console.debug(`Running in ${HOSTING_ENV} (${ENV})`,); // class MissingKeyError implements Error { // constructor(key: string) { diff --git a/common/src/geodb.ts b/common/src/geodb.ts index 0b3057ca..c0d27e00 100644 --- a/common/src/geodb.ts +++ b/common/src/geodb.ts @@ -23,10 +23,10 @@ export const geodbFetch = async (endpoint: string) => { } const data = await res.json() - console.log('geodbFetch', endpoint, data) + console.debug('geodbFetch', endpoint, data) return {status: 'success', data} } catch (error) { - console.log('geodbFetch', endpoint, error) + console.debug('geodbFetch', endpoint, error) return {status: 'failure', data: error} } } \ No newline at end of file diff --git a/common/src/love/compatibility-util.ts b/common/src/love/compatibility-util.ts index 43148894..5dc10064 100644 --- a/common/src/love/compatibility-util.ts +++ b/common/src/love/compatibility-util.ts @@ -5,7 +5,7 @@ const isPreferredGender = ( preferredGenders: string[] | undefined, gender: string | undefined ) => { - // console.log('isPreferredGender', preferredGenders, gender) + // console.debug('isPreferredGender', preferredGenders, gender) if (preferredGenders === undefined || preferredGenders.length === 0 || gender === undefined) return true // If simple gender preference, don't include non-binary. @@ -19,7 +19,7 @@ const isPreferredGender = ( } export const areGenderCompatible = (profile1: ProfileRow, profile2: ProfileRow) => { - // console.log('areGenderCompatible', isPreferredGender(profile1.pref_gender, profile2.gender), isPreferredGender(profile2.pref_gender, profile1.gender)) + // console.debug('areGenderCompatible', isPreferredGender(profile1.pref_gender, profile2.gender), isPreferredGender(profile2.pref_gender, profile1.gender)) return ( isPreferredGender(profile1.pref_gender, profile2.gender) && isPreferredGender(profile2.pref_gender, profile1.gender) diff --git a/common/src/love/profile.ts b/common/src/love/profile.ts index f0d09a74..27d39b36 100644 --- a/common/src/love/profile.ts +++ b/common/src/love/profile.ts @@ -4,7 +4,7 @@ import { User } from 'common/user' export type ProfileRow = Row<'profiles'> export type Profile = ProfileRow & { user: User } export const getProfileRow = async (userId: string, db: SupabaseClient) => { - console.log('getProfileRow', userId) + console.debug('getProfileRow', userId) const res = await run(db.from('profiles').select('*').eq('user_id', userId)) return res.data[0] } diff --git a/common/src/secrets.ts b/common/src/secrets.ts index fcdc22df..4d88e23c 100644 --- a/common/src/secrets.ts +++ b/common/src/secrets.ts @@ -32,7 +32,7 @@ type SecretId = (typeof secrets)[number] export const getSecrets = async (credentials?: any, ...ids: SecretId[]) => { if (!ids.length && IS_LOCAL) return {} - // console.log('Fetching secrets...') + // console.debug('Fetching secrets...') let client: SecretManagerServiceClient if (credentials) { const projectId = credentials['project_id'] @@ -47,7 +47,7 @@ export const getSecrets = async (credentials?: any, ...ids: SecretId[]) => { const secretIds = ids.length > 0 ? ids : secrets - console.log('secretIds', secretIds) + console.debug('secretIds', secretIds) const fullSecretNames = secretIds.map( (secret: string) => @@ -75,7 +75,7 @@ export const loadSecretsToEnv = async (credentials?: any) => { for (const [key, value] of Object.entries(allSecrets)) { if (key && value) { process.env[key] = value - // console.log(key, value) + // console.debug(key, value) } } refreshConfig() diff --git a/common/src/supabase/utils.ts b/common/src/supabase/utils.ts index 54c65fa2..70fab2da 100644 --- a/common/src/supabase/utils.ts +++ b/common/src/supabase/utils.ts @@ -30,7 +30,7 @@ export function createClient( opts?: SupabaseClientOptionsGeneric<'public'> ) { const url = `https://${instanceId}.supabase.co` - // console.log('createClient', instanceId, key, opts) + // console.debug('createClient', instanceId, key, opts) return createClientGeneric( url, key, diff --git a/common/src/util/api.ts b/common/src/util/api.ts index 05c1e365..985fe64b 100644 --- a/common/src/util/api.ts +++ b/common/src/util/api.ts @@ -67,7 +67,7 @@ export async function baseApiCall(props: { body: params == null || method === 'GET' ? undefined : JSON.stringify(params), }) - // console.log(req) + // console.debug(req) return fetch(req).then(async (resp) => { const json = (await resp.json()) as { [k: string]: any } if (!resp.ok) { diff --git a/common/src/util/matrix.ts b/common/src/util/matrix.ts index 98a19ada..e1febba6 100644 --- a/common/src/util/matrix.ts +++ b/common/src/util/matrix.ts @@ -32,7 +32,7 @@ export function factorizeMatrix( const mFeatures = fillMatrix(m, FEATURES, initCell) const nFeatures = fillMatrix(n, FEATURES, initCell) - console.log('rows', m, 'columns', n, 'numPoints', points) + console.debug('rows', m, 'columns', n, 'numPoints', points) const updateFeature = (a: number, b: number, error: number) => a + LEARNING_RATE * (2 * error * b - REGULARIZATION_RATE * a) @@ -75,7 +75,7 @@ export function factorizeMatrix( } } } - console.log(iter, 'error', totalError / points) + console.debug(iter, 'error', totalError / points) // Complete factorization process if total error falls below a certain threshold if (totalError / points < THRESHOLD) break diff --git a/common/src/wants-kids.ts b/common/src/wants-kids.ts index 84ca86b0..4bdecf6b 100644 --- a/common/src/wants-kids.ts +++ b/common/src/wants-kids.ts @@ -44,7 +44,7 @@ export function wantsKidsToHasKidsFilter(wantsKidsStrength: wantsKidsDatabase) { export function wantsKidsDatabaseToWantsKidsFilter( wantsKidsStrength: wantsKidsDatabase ) { - // console.log(wantsKidsStrength) + // console.debug(wantsKidsStrength) if (wantsKidsStrength == wantsKidsLabels.no_preference.strength) { return wantsKidsLabels.no_preference.strength } diff --git a/web/components/answers/add-compatibility-question-button.tsx b/web/components/answers/add-compatibility-question-button.tsx index 89b6ace6..c22cec53 100644 --- a/web/components/answers/add-compatibility-question-button.tsx +++ b/web/components/answers/add-compatibility-question-button.tsx @@ -58,7 +58,7 @@ function AddCompatibilityQuestionModal(props: { ) const afterAddQuestion = (newQuestion: rowFor<'love_questions'>) => { setDbQuestion(newQuestion) - console.log('setDbQuestion', newQuestion) + console.debug('setDbQuestion', newQuestion) } return ( @@ -137,7 +137,7 @@ function CreateCompatibilityModalContent(props: { options: generateJson(), }; const newQuestion = await api('create-compatibility-question', data) - console.log('create-compatibility-question', newQuestion, data) + console.debug('create-compatibility-question', newQuestion, data) const q = newQuestion?.question if (q) { afterAddQuestion(q as rowFor<'love_questions'>) diff --git a/web/components/bio/editable-bio.tsx b/web/components/bio/editable-bio.tsx index e16ebc15..45eaf470 100644 --- a/web/components/bio/editable-bio.tsx +++ b/web/components/bio/editable-bio.tsx @@ -130,18 +130,18 @@ export function SignupBio(props: { { - // console.log('onchange', editor?.getText()) + // console.debug('onchange', editor?.getText()) if (!editor) return const e = editor.getJSON() - // console.log(e) + // console.debug(e) // const text = e.content.map((block: any) => block.content?.map((c: any) => c.text).join('') ?? '').join(''); // setCharLength(text.length) - // console.log(text, text.length) + // console.debug(text, text.length) // if (text.length < 250) { // return; // do not save // } - // console.log('bio changed', e, profile.bio); + // console.debug('bio changed', e, profile.bio); onChange(e) }} /> diff --git a/web/components/browse-matches-button.tsx b/web/components/browse-matches-button.tsx index aec1ef7f..e81f9c68 100644 --- a/web/components/browse-matches-button.tsx +++ b/web/components/browse-matches-button.tsx @@ -55,7 +55,7 @@ // // }) // setDialogOpen(false) // -// // console.log('result', result) +// // console.debug('result', result) // // // if (result.success) { // // window.location.reload() diff --git a/web/components/filters/use-filters.ts b/web/components/filters/use-filters.ts index d821a171..72412a89 100644 --- a/web/components/filters/use-filters.ts +++ b/web/components/filters/use-filters.ts @@ -80,7 +80,7 @@ export const useFilters = (you: Profile | undefined) => { (you?.wants_kids_strength ?? 2) as wantsKidsDatabase ), } - console.log(you, yourFilters) + console.debug(you, yourFilters) const isYourFilters = !!you && diff --git a/web/components/optional-profile-form.tsx b/web/components/optional-profile-form.tsx index 54954743..f0fc5fa0 100644 --- a/web/components/optional-profile-form.tsx +++ b/web/components/optional-profile-form.tsx @@ -65,7 +65,7 @@ export const OptionalLoveUserForm = (props: { const handleSubmit = async () => { setIsSubmitting(true) const {bio: _, ...otherProfileProps} = profile - console.log('otherProfileProps', removeNullOrUndefinedProps(otherProfileProps)) + console.debug('otherProfileProps', removeNullOrUndefinedProps(otherProfileProps)) const {error} = await tryCatch( updateProfile(removeNullOrUndefinedProps(otherProfileProps) as any) ) diff --git a/web/components/profile/profile-header.tsx b/web/components/profile/profile-header.tsx index 97c36eab..dc3d104f 100644 --- a/web/components/profile/profile-header.tsx +++ b/web/components/profile/profile-header.tsx @@ -46,7 +46,7 @@ export default function ProfileHeader(props: { const isCurrentUser = currentUser?.id === user.id const [showVisibilityModal, setShowVisibilityModal] = useState(false) - console.log('ProfileProfileHeader', {user, profile, currentUser}) + console.debug('ProfileProfileHeader', {user, profile, currentUser}) return ( diff --git a/web/components/profile/profile-info.tsx b/web/components/profile/profile-info.tsx index a40e6b71..d4355cb7 100644 --- a/web/components/profile/profile-info.tsx +++ b/web/components/profile/profile-info.tsx @@ -24,7 +24,7 @@ export function ProfileInfo(props: { fromSignup?: boolean }) { const {profile, user, refreshProfile, fromProfilePage, fromSignup} = props - console.log('Rendering Profile for', user.username, user.name, props) + console.debug('Rendering Profile for', user.username, user.name, props) const currentUser = useUser() // const currentProfile = useProfile() diff --git a/web/components/questions-form.tsx b/web/components/questions-form.tsx index 39747300..4c5c9984 100644 --- a/web/components/questions-form.tsx +++ b/web/components/questions-form.tsx @@ -141,7 +141,7 @@ const QuestionRow = (props: { row: rowFor<'love_questions'>; user: User }) => { className={'w-44'} choicesMap={options} setChoice={(choice) => { - // console.log(choice) + // console.debug(choice) const updatedForm = { ...form, multiple_choice: choice } setForm(updatedForm) submitAnswer(updatedForm) diff --git a/web/components/required-profile-form.tsx b/web/components/required-profile-form.tsx index b4ebf95e..b5ecc06c 100644 --- a/web/components/required-profile-form.tsx +++ b/web/components/required-profile-form.tsx @@ -128,7 +128,7 @@ export const RequiredLoveUserForm = (props: { { - console.log('bio changed', e, profile.bio) + console.debug('bio changed', e, profile.bio) setProfile('bio', e) }} /> diff --git a/web/components/widgets/avatar.tsx b/web/components/widgets/avatar.tsx index 06ec18ec..3272ca70 100644 --- a/web/components/widgets/avatar.tsx +++ b/web/components/widgets/avatar.tsx @@ -50,7 +50,7 @@ export const Avatar = memo( : `https://ui-avatars.com/api/?name=${encodeURIComponent(fallbackInitial)}`; - // console.log(url) + // console.debug(url) // there can be no avatar URL or username in the feed, we show a "submit comment" // item with a fake grey user circle guy even if you aren't signed in diff --git a/web/components/widgets/likes-display.tsx b/web/components/widgets/likes-display.tsx index 8bb9e544..7290c958 100644 --- a/web/components/widgets/likes-display.tsx +++ b/web/components/widgets/likes-display.tsx @@ -125,7 +125,7 @@ const UserAvatar = (props: { userId: string; className?: string }) => { const profile = useProfileByUserId(userId) const user = useUserById(userId) - // console.log('UserAvatar', user?.username, profile?.pinned_url) + // console.debug('UserAvatar', user?.username, profile?.pinned_url) if (!profile) return diff --git a/web/hooks/use-nearby-locations.ts b/web/hooks/use-nearby-locations.ts index 809c93f5..99f01d1d 100644 --- a/web/hooks/use-nearby-locations.ts +++ b/web/hooks/use-nearby-locations.ts @@ -19,12 +19,12 @@ export function useNearbyCities( cityId: referenceCityId, radius, }).then((result) => { - console.log('search-near-city', result) + console.debug('search-near-city', result) if (thisSearchCount == searchCount.current) { if (result.status === 'failure') { setNearbyCities(null) lastKnownCities.current = null - console.log('ERROR:', result.data) + console.error(result.data) } else { const cities = (result.data.data as any[]).map((city) => city.id.toString() diff --git a/web/hooks/use-private-messages.ts b/web/hooks/use-private-messages.ts index 32b6b032..ecc77519 100644 --- a/web/hooks/use-private-messages.ts +++ b/web/hooks/use-private-messages.ts @@ -22,7 +22,7 @@ export function usePrivateMessages( limit: number, userId: string ) { - console.log('getWebsocketUrl', getWebsocketUrl()) + // console.debug('getWebsocketUrl', getWebsocketUrl()) const [messages, setMessages] = usePersistentLocalState< PrivateChatMessage[] | undefined >(undefined, `private-messages-${channelId}-${limit}-v1`) diff --git a/web/hooks/use-profile.ts b/web/hooks/use-profile.ts index b989afb7..a28910e5 100644 --- a/web/hooks/use-profile.ts +++ b/web/hooks/use-profile.ts @@ -15,7 +15,7 @@ export const useProfile = () => { const refreshProfile = () => { if (user) { - console.log('Refreshing profile in useProfile for', user?.username, profile); + console.debug('Refreshing profile in useProfile for', user?.username, profile); getProfileRow(user.id, db).then((profile) => { if (!profile) setProfile(null) else setProfile(profile) @@ -38,18 +38,18 @@ export const useProfileByUser = (user: User | undefined) => { function refreshProfile() { if (userId) { - console.log('Refreshing profile in useProfileByUser for', user?.username, profile); + console.debug('Refreshing profile in useProfileByUser for', user?.username, profile); getProfileRow(userId, db) .then((profile) => { if (!profile) setProfile(null) else setProfile({...profile, user}) }) .catch(error => { - console.log('Warning: profile not found', user?.username, error); + console.debug('Warning: profile not found', user?.username, error); setProfile(null) return }); - console.log('End Refreshing profile for', user?.username, profile); + console.debug('End Refreshing profile for', user?.username, profile); } } @@ -66,7 +66,7 @@ export const useProfileByUserId = (userId: string | undefined) => { >(undefined, `profile-${userId}`) useEffect(() => { - console.log('Refreshing profile in useProfileByUserId for', userId, profile); + console.debug('Refreshing profile in useProfileByUserId for', userId, profile); if (userId) getProfileRow(userId, db).then((profile) => { if (!profile) setProfile(null) diff --git a/web/hooks/use-user.ts b/web/hooks/use-user.ts index e3b380eb..41d3ff69 100644 --- a/web/hooks/use-user.ts +++ b/web/hooks/use-user.ts @@ -29,7 +29,7 @@ export const useWebsocketUser = (userId: string | undefined) => { useApiSubscription({ topics: [`user/${userId ?? '_'}`], onBroadcast: ({ data }) => { - console.log(data) + console.debug(data) setUser((user) => { if (!user || !data.user) { return user diff --git a/web/lib/firebase/google-onetap-login.tsx b/web/lib/firebase/google-onetap-login.tsx index 64e398e1..ddba876e 100644 --- a/web/lib/firebase/google-onetap-login.tsx +++ b/web/lib/firebase/google-onetap-login.tsx @@ -10,7 +10,7 @@ async function handleResponse(response: any) { const credential = GoogleAuthProvider.credential(idToken) try { const result = await signInWithCredential(auth, credential) - console.log(result.user) + console.debug(result.user) } catch (error) { console.error('could not log in via onetap', error) } diff --git a/web/lib/supabase/db.ts b/web/lib/supabase/db.ts index bb81e0b2..0b09aef6 100644 --- a/web/lib/supabase/db.ts +++ b/web/lib/supabase/db.ts @@ -4,7 +4,7 @@ import { ENV_CONFIG } from 'common/envs/constants' let currentToken: string | undefined export function initSupabaseClient() { - // console.log('Initializing supabase client', ENV_CONFIG.supabaseInstanceId, ENV_CONFIG.supabaseAnonKey) + // console.debug('Initializing supabase client', ENV_CONFIG.supabaseInstanceId, ENV_CONFIG.supabaseAnonKey) return createClient(ENV_CONFIG.supabaseInstanceId, ENV_CONFIG.supabaseAnonKey) } diff --git a/web/lib/util/copy.ts b/web/lib/util/copy.ts index 8746453a..90e8e84d 100644 --- a/web/lib/util/copy.ts +++ b/web/lib/util/copy.ts @@ -14,14 +14,14 @@ export function copyToClipboard(text: string) { (window as any).clipboardData && (window as any).clipboardData.setData ) { - console.log('copy 2') + console.debug('copy 2') // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. return (window as any).clipboardData.setData('Text', text) } else if ( document.queryCommandSupported && document.queryCommandSupported('copy') ) { - console.log('copy 3') + console.debug('copy 3') const textarea = document.createElement('textarea') textarea.textContent = text textarea.style.position = 'fixed' // Prevent scrolling to bottom of page in Microsoft Edge. diff --git a/web/pages/[username]/index.tsx b/web/pages/[username]/index.tsx index 6410f8f9..3442eaf5 100644 --- a/web/pages/[username]/index.tsx +++ b/web/pages/[username]/index.tsx @@ -24,7 +24,7 @@ export const getStaticProps: GetStaticProps< UserPageProps, { username: string } > = async (props) => { - // console.log('Starting getStaticProps in /[username]') + // console.debug('Starting getStaticProps in /[username]') const {username} = props.params! const user = await getUserForStaticProps(db, username) @@ -86,7 +86,7 @@ type ActiveUserPageProps = { } export default function UserPage(props: UserPageProps) { - // console.log('Starting UserPage in /[username]') + // console.debug('Starting UserPage in /[username]') if (!props.user) { return
This account has been deleted
} @@ -99,7 +99,7 @@ export default function UserPage(props: UserPageProps) { } function UserPageInner(props: ActiveUserPageProps) { - // console.log('Starting UserPageInner in /[username]') + // console.debug('Starting UserPageInner in /[username]') const {user, username} = props const router = useRouter() const {query} = router @@ -117,7 +117,7 @@ function UserPageInner(props: ActiveUserPageProps) { const {profile: clientProfile, refreshProfile} = useProfileByUser(user) // Show previous profile while loading another one const profile = clientProfile ?? staticProfile - // console.log('profile:', user?.username, profile, clientProfile, staticProfile) + // console.debug('profile:', user?.username, profile, clientProfile, staticProfile) return ( { setSubmitting(false) - console.log('SUCCESS creating firebase user', userCredential) + console.debug('SUCCESS creating firebase user', userCredential) }) .catch((error) => { setSubmitting(false) const errorCode = error.code const errorMessage = error.message - console.log('ERROR creating firebase user', errorCode, errorMessage) + console.error('ERROR creating firebase user', errorCode, errorMessage) }) } const login = () => { @@ -57,13 +57,13 @@ export default function TestUser() { signInWithEmailAndPassword(auth, email, password) .then((userCredential) => { setSubmitting(false) - console.log('SUCCESS logging in firebase user', userCredential) + console.debug('SUCCESS logging in firebase user', userCredential) }) .catch((error) => { setSigningIn(false) const errorCode = error.code const errorMessage = error.message - console.log('ERROR logging in firebase user', errorCode, errorMessage) + console.error('ERROR logging in firebase user', errorCode, errorMessage) }) } diff --git a/web/pages/api/og/profile.tsx b/web/pages/api/og/profile.tsx index 7e648a12..9bcdce85 100644 --- a/web/pages/api/og/profile.tsx +++ b/web/pages/api/og/profile.tsx @@ -115,7 +115,7 @@ export default async function handler(req: NextRequest) { return new ImageResponse(classToTw(image), options as ImageResponseOptions) } catch (e: any) { - console.log(`${e.message}`) + console.error(`${e.message}`) return new Response(`Failed to generate the image`, { status: 500, }) diff --git a/web/pages/index.tsx b/web/pages/index.tsx index 9c508ad8..8f1bdcbc 100644 --- a/web/pages/index.tsx +++ b/web/pages/index.tsx @@ -7,7 +7,7 @@ import {ProfilesHome} from "web/components/profiles/profiles-home"; export default function ProfilesPage() { const user = useUser(); - console.log('user:', user) + console.debug('user:', user) return ( diff --git a/web/pages/register.tsx b/web/pages/register.tsx index cc09a84d..9d8ec9fb 100644 --- a/web/pages/register.tsx +++ b/web/pages/register.tsx @@ -57,7 +57,7 @@ function RegisterComponent() { const handleEmailPasswordSignUp = async (email: string, password: string) => { try { const creds = await createUserWithEmailAndPassword(auth, email, password); - console.log("User signed up:", creds.user); + console.debug("User signed up:", creds.user); } catch (error) { console.error("Error signing up:", error); if (error instanceof Error && error.message.includes("email-already-in-use")) { diff --git a/web/pages/signin.tsx b/web/pages/signin.tsx index 79a994ae..4399fbe9 100644 --- a/web/pages/signin.tsx +++ b/web/pages/signin.tsx @@ -41,7 +41,7 @@ function RegisterComponent() { useEffect(() => { const checkAndRedirect = async () => { if (user) { - console.log("User signed in:", user); + console.debug("User signed in:", user); try { const profile = await getProfileRow(user.id, db) if (profile) { @@ -80,7 +80,7 @@ function RegisterComponent() { const handleEmailPasswordSignIn = async (email: string, password: string) => { try { const creds = await signInWithEmailAndPassword(auth, email, password); - console.log(creds) + console.debug(creds) } catch (error) { console.error("Error signing in:", error); const message = 'Failed to sign in with your email and password'; @@ -115,7 +115,7 @@ function RegisterComponent() { } } - console.log('Form rendering'); + console.debug('Form rendering'); return (
diff --git a/web/pages/signup.tsx b/web/pages/signup.tsx index ac13ee26..35e0392d 100644 --- a/web/pages/signup.tsx +++ b/web/pages/signup.tsx @@ -20,7 +20,7 @@ import {Button} from "web/components/buttons/button"; export default function SignupPage() { const [step, setStep] = useState(0) const user = useUser() - console.log('user:', user) + console.debug('user:', user) const router = useRouter() useTracking('view love signup page') @@ -91,7 +91,7 @@ export default function SignupPage() { : undefined setIsSubmitting(true) - console.log('profileForm', profileForm) + console.debug('profileForm', profileForm) const profile = await api( 'create-profile', removeNullOrUndefinedProps({