Merge pull request #18571 from overleaf/mj-error-reporting-more-info

[web] Add frontend release and load time to error reporting

GitOrigin-RevId: f362569d0012131d4538016573d1488b30b5c790
This commit is contained in:
Mathias Jakobsen 2024-05-29 13:23:31 +01:00 committed by Copybot
parent 36f0a3e01a
commit 80044b53b4

View file

@ -26,6 +26,8 @@ import { populateReferenceScope } from '@/features/ide-react/context/references-
import { ReactScopeEventEmitter } from '@/features/ide-react/scope-event-emitter/react-scope-event-emitter' import { ReactScopeEventEmitter } from '@/features/ide-react/scope-event-emitter/react-scope-event-emitter'
import getMeta from '@/utils/meta' import getMeta from '@/utils/meta'
const LOADED_AT = new Date()
type IdeReactContextValue = { type IdeReactContextValue = {
projectId: string projectId: string
eventEmitter: IdeEventEmitter eventEmitter: IdeEventEmitter
@ -94,6 +96,7 @@ export const IdeReactProvider: FC = ({ children }) => {
) )
const [eventLog] = useState(() => new EventLog()) const [eventLog] = useState(() => new EventLog())
const [startedFreeTrial, setStartedFreeTrial] = useState(false) const [startedFreeTrial, setStartedFreeTrial] = useState(false)
const release = getMeta('ol-ExposedSettings')?.sentryRelease ?? null
// Set to true only after project:joined has fired and all its listeners have // Set to true only after project:joined has fired and all its listeners have
// been called // been called
@ -112,6 +115,8 @@ export const IdeReactProvider: FC = ({ children }) => {
// @ts-ignore // @ts-ignore
transport: socket.socket?.transport?.name, transport: socket.socket?.transport?.name,
client_now: new Date(), client_now: new Date(),
release,
client_load: LOADED_AT,
} }
const errorObj: Record<string, any> = {} const errorObj: Record<string, any> = {}
@ -130,7 +135,7 @@ export const IdeReactProvider: FC = ({ children }) => {
}, },
}) })
}, },
[socket.socket] [socket.socket, release]
) )
// Populate scope values when joining project, then fire project:joined event // Populate scope values when joining project, then fire project:joined event