Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
yarn datadog-ci sourcemaps upload ./dist \
--service=web \
--release-version=${{env.ACTION_VERSION}} \
--minified-path-prefix="/parabol/dist/"
--minified-path-prefix="/home/node/parabol/dist/"
- name: Report Status
if: failure()
uses: ravsamhq/notify-slack-action@v2
Expand Down
7 changes: 2 additions & 5 deletions packages/server/graphql/private/mutations/disconnectSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ import {MutationResolvers} from '../resolverTypes'

const disconnectSocket: MutationResolvers['disconnectSocket'] = async (
_source,
{userId},
{dataLoader, socketId}
{userId, socketId},
{dataLoader}
) => {
const redis = getRedis()

// AUTH
if (!socketId) return null

// RESOLUTION
const [user, userPresence] = await Promise.all([
dataLoader.get('users').load(userId),
Expand Down
4 changes: 4 additions & 0 deletions packages/server/graphql/private/typeDefs/Mutation.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ type Mutation {
the userId to disconnect
"""
userId: ID!
"""
the socketId of the user that disconnected
"""
socketId: ID!
): DisconnectSocketPayload

"""
Expand Down
7 changes: 6 additions & 1 deletion packages/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ tracer.init({
plugins: false,
version: __APP_VERSION__
})
tracer.use('ioredis').use('http').use('pg')
tracer
.use('ioredis')
.use('http', {
blocklist: ['/health', '/ready']
})
.use('pg')

process.on('SIGTERM', async (signal) => {
Logger.log(
Expand Down
2 changes: 1 addition & 1 deletion packages/server/utils/serverHealthChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ServerHealthChecker {
if (socketServers.includes(socketInstanceId)) return
// let GQL handle the disconnect logic so it can do special handling like notify team memers
Logger.log(`serverHealthChecker: ${socketId} is on dead instace ${socketInstanceId}`)
await callGQL(disconnectQuery, {userId})
await callGQL(disconnectQuery, {userId, socketId})
})
})
)
Expand Down
6 changes: 3 additions & 3 deletions packages/server/wsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ mutation ConnectSocket($socketInstanceId: ID!) {
}`

export const disconnectQuery = `
mutation DisconnectSocket($userId: ID!) {
disconnectSocket(userId: $userId) {
mutation DisconnectSocket($userId: ID!, $socketId: ID!) {
disconnectSocket(userId: $userId, socketId: $socketId) {
user {
id
}
Expand Down Expand Up @@ -212,7 +212,7 @@ export const wsHandler = makeBehavior<{token?: string}>({
const dataLoader = getNewDataLoader()
await execute({
document: parse(disconnectQuery),
variableValues: {userId},
variableValues: {userId, socketId},
schema: privateSchema,
contextValue: {dataLoader, ip: extra.ip, authToken, socketId}
})
Expand Down