Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Logging for deployment project update failed
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen committed Oct 27, 2023
1 parent 5641f2c commit 39c1b7b
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions packages/server-core/src/projects/project/project.resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,32 @@ import {
ProjectType
} from '@etherealengine/engine/src/schemas/projects/project.schema'
import type { HookContext } from '@etherealengine/server-core/declarations'
import multiLogger from '@etherealengine/server-core/src/ServerLogger'
import { fromDateTimeSql, getDateTimeSql } from '../../util/datetime-sql'

export const projectDbToSchema = (rawData: ProjectDatabaseType): ProjectType => {
let settings = JSON.parse(rawData.settings) as ProjectSettingType[]
const logger = multiLogger.child({ component: 'server:project.resolvers' })

// Usually above JSON.parse should be enough. But since our pre-feathers 5 data
// was serialized multiple times, therefore we need to parse it twice.
if (typeof settings === 'string') {
settings = JSON.parse(settings)
export const projectDbToSchema = (rawData: ProjectDatabaseType): ProjectType => {
let settings: any
try {
settings = JSON.parse(rawData.settings) as ProjectSettingType[]

// There are some old records in our database that requires further parsing.
// Usually above JSON.parse should be enough. But since our pre-feathers 5 data
// was serialized multiple times, therefore we need to parse it twice.
if (typeof settings === 'string') {
settings = JSON.parse(settings)

// There are some old records in our database that requires further parsing.
if (typeof settings === 'string') {
settings = JSON.parse(settings)
}
}
} catch (err) {
logger.error(rawData)
logger.error(typeof rawData)
logger.error(rawData.settings)
logger.error(typeof rawData.settings)
logger.error('Error parsing project settings', err)
}

return {
Expand Down

0 comments on commit 39c1b7b

Please sign in to comment.