From 673be745db0361afe54c27f0adda1e3249583b23 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:24:13 +0900 Subject: [PATCH] fix: upgrade snapshot-sentry --- package.json | 2 +- src/graphql/operations/aliases.ts | 2 +- src/graphql/operations/follows.ts | 2 +- src/graphql/operations/messages.ts | 2 +- src/graphql/operations/proposal.ts | 2 +- src/graphql/operations/proposals.ts | 2 +- src/graphql/operations/ranking.ts | 2 +- src/graphql/operations/space.ts | 2 +- src/graphql/operations/spaces.ts | 2 +- src/graphql/operations/statement.ts | 2 +- src/graphql/operations/statements.ts | 2 +- src/graphql/operations/subscriptions.ts | 2 +- src/graphql/operations/user.ts | 2 +- src/graphql/operations/users.ts | 2 +- src/graphql/operations/vote.ts | 4 ++-- src/graphql/operations/votes.ts | 6 +++--- src/helpers/moderation.ts | 2 +- yarn.lock | 8 ++++---- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index fd2a4a8e..642998ec 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@snapshot-labs/keycard": "^0.2.0", "@snapshot-labs/snapshot-metrics": "^1.0.0", - "@snapshot-labs/snapshot-sentry": "^1.1.0", + "@snapshot-labs/snapshot-sentry": "^1.3.0", "@snapshot-labs/snapshot.js": "^0.5.4", "bluebird": "^3.7.2", "connection-string": "^1.0.1", diff --git a/src/graphql/operations/aliases.ts b/src/graphql/operations/aliases.ts index faa48656..75d20964 100644 --- a/src/graphql/operations/aliases.ts +++ b/src/graphql/operations/aliases.ts @@ -37,7 +37,7 @@ export default async function (parent, args) { return await db.queryAsync(query, params); } catch (e: any) { log.error(`[graphql] aliases, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/follows.ts b/src/graphql/operations/follows.ts index 374a5037..c56132b7 100644 --- a/src/graphql/operations/follows.ts +++ b/src/graphql/operations/follows.ts @@ -40,7 +40,7 @@ export default async function (parent, args) { return follows.map(follow => formatFollow(follow)); } catch (e: any) { log.error(`[graphql] follows, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/messages.ts b/src/graphql/operations/messages.ts index e08d4601..42b5e689 100644 --- a/src/graphql/operations/messages.ts +++ b/src/graphql/operations/messages.ts @@ -36,7 +36,7 @@ export default async function (parent, args) { return await db.queryAsync(query, params); } catch (e: any) { log.error(`[graphql] messages, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/proposal.ts b/src/graphql/operations/proposal.ts index c15e3bd6..3190cc7a 100644 --- a/src/graphql/operations/proposal.ts +++ b/src/graphql/operations/proposal.ts @@ -15,7 +15,7 @@ export default async function (parent, { id }) { return proposals.map(proposal => formatProposal(proposal))[0] || null; } catch (e: any) { log.error(`[graphql] proposal, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { id } } }); + capture(e, { id }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/proposals.ts b/src/graphql/operations/proposals.ts index c86761f5..8f83a34f 100644 --- a/src/graphql/operations/proposals.ts +++ b/src/graphql/operations/proposals.ts @@ -94,7 +94,7 @@ export default async function (parent, args) { return proposals.map(proposal => formatProposal(proposal)); } catch (e: any) { log.error(`[graphql] proposals, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/ranking.ts b/src/graphql/operations/ranking.ts index 40229783..ade6315a 100644 --- a/src/graphql/operations/ranking.ts +++ b/src/graphql/operations/ranking.ts @@ -54,7 +54,7 @@ export default async function (_parent, args, context, info) { } catch (e: any) { log.error(`[graphql] spaces, ${JSON.stringify(e)}`); if (e instanceof PublicError) return e; - capture(e, { contexts: { input: { args, context, info } } }); + capture(e, { args, context, info }); return new Error('Unexpected error'); } } diff --git a/src/graphql/operations/space.ts b/src/graphql/operations/space.ts index d92296a1..d976459e 100644 --- a/src/graphql/operations/space.ts +++ b/src/graphql/operations/space.ts @@ -14,7 +14,7 @@ export default async function (_parent, { id }, context, info) { } catch (e: any) { log.error(`[graphql] space, ${JSON.stringify(e)}`); if (e instanceof PublicError) return e; - capture(e, { contexts: { input: { id, context, info } } }); + capture(e, { id, context, info }); return new Error('Unexpected error'); } } diff --git a/src/graphql/operations/spaces.ts b/src/graphql/operations/spaces.ts index e6090d7c..3bf15649 100644 --- a/src/graphql/operations/spaces.ts +++ b/src/graphql/operations/spaces.ts @@ -12,7 +12,7 @@ export default async function (_parent, args, context, info) { } catch (e: any) { log.error(`[graphql] spaces, ${JSON.stringify(e)}`); if (e instanceof PublicError) return e; - capture(e, { contexts: { input: { args, context, info } } }); + capture(e, { args, context, info }); return new Error('Unexpected error'); } } diff --git a/src/graphql/operations/statement.ts b/src/graphql/operations/statement.ts index dee24c3b..dbcc7a29 100644 --- a/src/graphql/operations/statement.ts +++ b/src/graphql/operations/statement.ts @@ -11,7 +11,7 @@ export default async function (parent, args) { return null; } catch (e: any) { log.error(`[graphql] statement, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/statements.ts b/src/graphql/operations/statements.ts index e489fb07..f55751d3 100644 --- a/src/graphql/operations/statements.ts +++ b/src/graphql/operations/statements.ts @@ -39,7 +39,7 @@ export default async function (parent, args) { return statements; } catch (e: any) { log.error(`[graphql] statements, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/subscriptions.ts b/src/graphql/operations/subscriptions.ts index 34a18a5c..4c197ce0 100644 --- a/src/graphql/operations/subscriptions.ts +++ b/src/graphql/operations/subscriptions.ts @@ -41,7 +41,7 @@ export default async function (parent, args) { return subscriptions.map(subscription => formatSubscription(subscription)); } catch (e: any) { log.error(`[graphql] subscriptions, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/user.ts b/src/graphql/operations/user.ts index 7bfcba24..1e99f151 100644 --- a/src/graphql/operations/user.ts +++ b/src/graphql/operations/user.ts @@ -12,7 +12,7 @@ export default async function (parent, args) { return null; } catch (e: any) { log.error(`[graphql] user, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/users.ts b/src/graphql/operations/users.ts index 6f1c0f26..1f821f93 100644 --- a/src/graphql/operations/users.ts +++ b/src/graphql/operations/users.ts @@ -37,7 +37,7 @@ export default async function (parent, args) { return users.map(user => formatUser(user)); } catch (e: any) { log.error(`[graphql] users, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { args } } }); + capture(e, { args }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/vote.ts b/src/graphql/operations/vote.ts index 2253100a..936c3d22 100644 --- a/src/graphql/operations/vote.ts +++ b/src/graphql/operations/vote.ts @@ -27,14 +27,14 @@ export default async function (parent, { id }, context, info) { result.proposal = formatProposal(proposals[0]); } catch (e: any) { log.error(`[graphql] vote, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { id, context, info } } }); + capture(e, { id, context, info }); return Promise.reject('request failed'); } } return result; } catch (e: any) { log.error(`[graphql] vote, ${JSON.stringify(e)}`); - capture(e, { contexts: { input: { id, context, info } } }); + capture(e, { id, context, info }); return Promise.reject('request failed'); } } diff --git a/src/graphql/operations/votes.ts b/src/graphql/operations/votes.ts index 15cf70e1..9874e25f 100644 --- a/src/graphql/operations/votes.ts +++ b/src/graphql/operations/votes.ts @@ -47,7 +47,7 @@ async function query(parent, args, context?, info?) { // TODO: we need settings in the vote as its being passed to formatSpace inside formatVote, Maybe we dont need to do this? votes = votes.map(vote => formatVote(vote)); } catch (e: any) { - capture(e, { contexts: { input: { args, context, info } } }); + capture(e, { args, context, info }); log.error(`[graphql] votes, ${JSON.stringify(e)}`); return Promise.reject('request failed'); } @@ -69,7 +69,7 @@ async function query(parent, args, context?, info?) { return vote; }); } catch (e: any) { - capture(e, { contexts: { input: { args, context, info } } }); + capture(e, { args, context, info }); log.error(`[graphql] votes, ${JSON.stringify(e)}`); return Promise.reject('request failed'); } @@ -92,7 +92,7 @@ async function query(parent, args, context?, info?) { return vote; }); } catch (e: any) { - capture(e, { contexts: { input: { args, context, info } } }); + capture(e, { args, context, info }); log.error(`[graphql] votes, ${JSON.stringify(e)}`); return Promise.reject('request failed'); } diff --git a/src/helpers/moderation.ts b/src/helpers/moderation.ts index 5f37fbfe..ec202d7e 100644 --- a/src/helpers/moderation.ts +++ b/src/helpers/moderation.ts @@ -27,7 +27,7 @@ async function run() { consecutiveFailsCount++; if (consecutiveFailsCount >= 5) { - capture(e, { contexts: { input: { url: moderationURL } } }); + capture(e, { url: moderationURL }); } log.error(`[moderation] failed to load ${JSON.stringify(e)}`); } diff --git a/yarn.lock b/yarn.lock index 89db33e0..64c41268 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1306,10 +1306,10 @@ express-prom-bundle "^6.6.0" prom-client "^14.2.0" -"@snapshot-labs/snapshot-sentry@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot-sentry/-/snapshot-sentry-1.1.0.tgz#b357d4789ffd287f90fb70e7f0b207b47627cf24" - integrity sha512-Z31Y/5RJkTudrUwPasRxfABEQG2eQ2Ka5+vpi5zEwspt5gwTEfVM8M1NlYMFikWYqXHvVk51EU3UmJTqgL6pIg== +"@snapshot-labs/snapshot-sentry@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot-sentry/-/snapshot-sentry-1.3.0.tgz#9822d62b9a8918c70a09167da7b36ff43b9edba0" + integrity sha512-Qy+uLwsLhlRjx8MSbVU46tYVbiA5fIp6i1bgyab5pHwqsBaP93sjQIBetfGzeWxmmUXI8cS4lUOCc/x0HXEEGg== dependencies: "@sentry/node" "^7.60.1"