Skip to content

Commit

Permalink
fix: no smart title, log socket server id
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
  • Loading branch information
mattkrick committed Feb 10, 2025
1 parent 74656b0 commit fec3d14
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/client/mutations/AutogroupMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ graphql`
reflectionGroups {
id
title
smartTitle
reflections {
id
plaintextContent
Expand Down
4 changes: 1 addition & 3 deletions packages/client/mutations/EndDraggingReflectionMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ const EndDraggingReflectionMutation: SimpleMutation<TEndDraggingReflectionMutati
isActive: true,
sortOrder: 0,
updatedAt: nowISO,
title: '',
smartTitle: ''
title: ''
}
reflectionGroupProxy = createProxyRecord(store, 'RetroReflectionGroup', reflectionGroup)
updateProxyRecord(reflection, {sortOrder: 0, reflectionGroupId: newReflectionGroupId})
Expand All @@ -201,7 +200,6 @@ const EndDraggingReflectionMutation: SimpleMutation<TEndDraggingReflectionMutati
})
reflection.setLinkedRecord(reflectionGroupProxy, 'retroReflectionGroup')
reflectionGroupProxy.setValue('', 'title')
reflectionGroupProxy.setValue('', 'smartTitle')
}
moveReflectionLocation(reflection, reflectionGroupProxy, oldReflectionGroupId, store)
}
Expand Down
4 changes: 3 additions & 1 deletion packages/server/graphql/ResponseStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import getGraphQLExecutor from '../utils/getGraphQLExecutor'
import sendToSentry from '../utils/sendToSentry'
import {SubscribeRequest} from './subscribeGraphQL'

const {SERVER_ID} = process.env

export default class ResponseStream implements AsyncIterableIterator<ExecutionResult> {
private sourceStream: SubscriptionIterator
private req: SubscribeRequest
Expand Down Expand Up @@ -51,7 +53,7 @@ export default class ResponseStream implements AsyncIterableIterator<ExecutionRe
docId: docId || '',
query: query || '',
variables: JSON.stringify(variables),
socketServerId: socketId,
socketServerId: SERVER_ID!,
executorServerId
}
})
Expand Down
4 changes: 3 additions & 1 deletion packages/server/graphql/handleGraphQLTrebuchetRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import sendToSentry from '../utils/sendToSentry'
import subscribeGraphQL from './subscribeGraphQL'
export type GraphQLMessageType = 'data' | 'complete' | 'error'

const {SERVER_ID} = process.env

const handleGraphQLTrebuchetRequest = async (
data: OutgoingMessage,
connectionContext: ConnectionContext
Expand Down Expand Up @@ -63,7 +65,7 @@ const handleGraphQLTrebuchetRequest = async (
docId: docId || '',
query: query || '',
variables: JSON.stringify(variables),
socketServerId: socketId
socketServerId: SERVER_ID!
}
})
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ const removeReflectionFromGroup = async (reflectionId: string, {dataLoader}: GQL
])
dataLoader.get('retroReflectionGroupsByMeetingId').clear(meetingId)
dataLoader.get('retroReflectionGroups').clearAll()
const oldReflectionGroup = meetingReflectionGroups.find((g) => g.id === oldReflectionGroupId)!
const oldReflectionGroup = meetingReflectionGroups.find((g) => g.id === oldReflectionGroupId)
const reflectionGroupsInColumn = meetingReflectionGroups
.filter((g) => g.promptId === promptId)
.sort((a, b) => (a.sortOrder < b.sortOrder ? -1 : 1))
let newSortOrder = 1e6
const oldReflectionGroupIdx = reflectionGroupsInColumn.findIndex(
(group) => group.id === oldReflectionGroup.id
(group) => group.id === oldReflectionGroup?.id
)
const sortOrderAtBottom =
(reflectionGroupsInColumn[reflectionGroupsInColumn.length - 1]?.sortOrder ?? 1e6) +
1 +
dndNoise()
if (oldReflectionGroupIdx === -1 || reflection.promptId !== oldReflectionGroup.promptId) {
if (
oldReflectionGroupIdx === -1 ||
!oldReflectionGroup ||
reflection.promptId !== oldReflectionGroup.promptId
) {
newSortOrder = sortOrderAtBottom
} else if (oldReflectionGroupIdx === reflectionGroupsInColumn.length - 1) {
newSortOrder = oldReflectionGroup.sortOrder + 1 + dndNoise()
Expand Down
4 changes: 3 additions & 1 deletion packages/server/utils/publishInternalGQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface Options {
authToken: AuthToken
}

const {SERVER_ID} = process.env

const publishInternalGQL = async <NarrowResponse>(options: Options) => {
const {socketId, query, ip, authToken, variables} = options
try {
Expand All @@ -32,7 +34,7 @@ const publishInternalGQL = async <NarrowResponse>(options: Options) => {
authToken: JSON.stringify(authToken),
query: query || '',
variables: JSON.stringify(variables),
socketServerId: socketId
socketServerId: SERVER_ID!
}
})
} else {
Expand Down

0 comments on commit fec3d14

Please sign in to comment.