Skip to content

Commit b969fda

Browse files
authored
fix: abs path for sourcemaps, add hc to blocklist for dd, disconnect query (#11122)
Signed-off-by: Matt Krick <[email protected]>
1 parent 06e4bbd commit b969fda

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

Diff for: .github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
yarn datadog-ci sourcemaps upload ./dist \
139139
--service=web \
140140
--release-version=${{env.ACTION_VERSION}} \
141-
--minified-path-prefix="/parabol/dist/"
141+
--minified-path-prefix="/home/node/parabol/dist/"
142142
- name: Report Status
143143
if: failure()
144144
uses: ravsamhq/notify-slack-action@v2

Diff for: packages/server/graphql/private/mutations/disconnectSocket.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ import {MutationResolvers} from '../resolverTypes'
88

99
const disconnectSocket: MutationResolvers['disconnectSocket'] = async (
1010
_source,
11-
{userId},
12-
{dataLoader, socketId}
11+
{userId, socketId},
12+
{dataLoader}
1313
) => {
1414
const redis = getRedis()
1515

16-
// AUTH
17-
if (!socketId) return null
18-
1916
// RESOLUTION
2017
const [user, userPresence] = await Promise.all([
2118
dataLoader.get('users').load(userId),

Diff for: packages/server/graphql/private/typeDefs/Mutation.graphql

+4
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ type Mutation {
149149
the userId to disconnect
150150
"""
151151
userId: ID!
152+
"""
153+
the socketId of the user that disconnected
154+
"""
155+
socketId: ID!
152156
): DisconnectSocketPayload
153157

154158
"""

Diff for: packages/server/server.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ tracer.init({
3030
plugins: false,
3131
version: __APP_VERSION__
3232
})
33-
tracer.use('ioredis').use('http').use('pg')
33+
tracer
34+
.use('ioredis')
35+
.use('http', {
36+
blocklist: ['/health', '/ready']
37+
})
38+
.use('pg')
3439

3540
process.on('SIGTERM', async (signal) => {
3641
Logger.log(

Diff for: packages/server/utils/serverHealthChecker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ServerHealthChecker {
7171
if (socketServers.includes(socketInstanceId)) return
7272
// let GQL handle the disconnect logic so it can do special handling like notify team memers
7373
Logger.log(`serverHealthChecker: ${socketId} is on dead instace ${socketInstanceId}`)
74-
await callGQL(disconnectQuery, {userId})
74+
await callGQL(disconnectQuery, {userId, socketId})
7575
})
7676
})
7777
)

Diff for: packages/server/wsHandler.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ mutation ConnectSocket($socketInstanceId: ID!) {
4949
}`
5050

5151
export const disconnectQuery = `
52-
mutation DisconnectSocket($userId: ID!) {
53-
disconnectSocket(userId: $userId) {
52+
mutation DisconnectSocket($userId: ID!, $socketId: ID!) {
53+
disconnectSocket(userId: $userId, socketId: $socketId) {
5454
user {
5555
id
5656
}
@@ -212,7 +212,7 @@ export const wsHandler = makeBehavior<{token?: string}>({
212212
const dataLoader = getNewDataLoader()
213213
await execute({
214214
document: parse(disconnectQuery),
215-
variableValues: {userId},
215+
variableValues: {userId, socketId},
216216
schema: privateSchema,
217217
contextValue: {dataLoader, ip: extra.ip, authToken, socketId}
218218
})

0 commit comments

Comments
 (0)