Skip to content

Commit b032fa1

Browse files
authored
fix: slow queries (#12640)
Signed-off-by: Matt Krick <matt.krick@gmail.com>
1 parent 6bbf49e commit b032fa1

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

packages/server/graphql/public/mutations/acceptTeamInvitation.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ const acceptTeamInvitation: MutationResolvers['acceptTeamInvitation'] = async (
121121
})
122122
// This is to triage https://github.com/ParabolInc/parabol/issues/11167. We know it worked if we don't see it again
123123
context.authToken = nextAuthToken
124-
// if this gets called without a websocket, we need to set it: https://github.com/ParabolInc/parabol/issues/12610
125-
setAuthCookie(context, nextAuthToken)
124+
// if this gets called without a websocket (context.request), we need to set it: https://github.com/ParabolInc/parabol/issues/12610
125+
if (context.request) {
126+
setAuthCookie(context, nextAuthToken)
127+
}
126128
// Send the new team member a welcome & a new token
127129
publish(SubscriptionChannel.NOTIFICATION, viewerId, 'AuthTokenPayload', {
128130
tms
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type {Kysely} from 'kysely'
2+
3+
// `any` is required here since migrations should be frozen in time. alternatively, keep a "snapshot" db interface.
4+
export async function up(db: Kysely<any>): Promise<void> {
5+
await db.schema
6+
.createIndex('MeetingTemplate_updatedAt_idx')
7+
.on('MeetingTemplate')
8+
.column('updatedAt')
9+
.execute()
10+
}
11+
12+
// `any` is required here since migrations should be frozen in time. alternatively, keep a "snapshot" db interface.
13+
export async function down(db: Kysely<any>): Promise<void> {
14+
// down migration code goes here...
15+
// note: down migrations are optional. you can safely delete this function.
16+
// For more info, see: https://kysely.dev/docs/migrations
17+
}

packages/server/scim/UserEgress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ SCIMMY.Resources.declare(SCIMMY.Resources.User).egress(async (resource, ctx: SCI
6464
.selectAll()
6565
.where((eb) =>
6666
eb.or([
67-
eb('scimId', '=', scimId),
67+
eb.and([eb('scimId', '=', scimId), eb('scimUserName', 'is not', null)]),
6868
eb('domain', '=', eb.fn.any(eb.val(domains))),
6969
eb('id', '=', eb.fn.any(eb.val(orgUsers)))
7070
])

packages/server/yoga.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export const yoga = createYoga<ServerContext, UserContext>({
186186
const headerToken = authHeader?.slice(7)
187187
const cookieToken = getAuthTokenFromCookie(headers.get('cookie'))
188188
const token = headerToken || cookieToken
189-
const authToken = getVerifiedAuthToken(token)
189+
const authToken = getVerifiedAuthToken(token, false)
190190

191191
const isSuperUser = authToken?.rol === 'su'
192192
const isOAuthToken = authToken?.aud === 'action-oauth2'

0 commit comments

Comments
 (0)