Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sentry #211

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/frontpage/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,3 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Config File
.env.sentry-build-plugin
27 changes: 0 additions & 27 deletions packages/frontpage/app/global-error.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions packages/frontpage/instrumentation.ts

This file was deleted.

55 changes: 26 additions & 29 deletions packages/frontpage/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { db } from "./db";
import * as schema from "./schema";
import { eq } from "drizzle-orm";
import { getDidFromHandleOrDid } from "./data/atproto/identity";
import { startSpan } from "@sentry/nextjs";

const USER_AGENT = "appview/@frontpage.fyi (@tom-sherman.com)";

Expand Down Expand Up @@ -383,39 +382,37 @@ export async function signOut() {
.where(eq(schema.OauthSession.sessionId, session.user.sessionId));
}

export const getSession = cache(() =>
startSpan({ name: "getSession" }, async () => {
const tokenCookie = (await cookies()).get(AUTH_COOKIE_NAME);
if (!tokenCookie) {
return null;
}
export const getSession = cache(async () => {
const tokenCookie = (await cookies()).get(AUTH_COOKIE_NAME);
if (!tokenCookie) {
return null;
}

let token;
try {
token = await jwtVerify(tokenCookie.value, await getPublicJwk());
} catch (e) {
console.error("Failed to verify token", e);
return null;
}
let token;
try {
token = await jwtVerify(tokenCookie.value, await getPublicJwk());
} catch (e) {
console.error("Failed to verify token", e);
return null;
}

if (!token.payload.jti) {
return null;
}
if (!token.payload.jti) {
return null;
}

const [session] = await db
.select()
.from(schema.OauthSession)
.where(eq(schema.OauthSession.sessionId, Number(token.payload.jti)));
const [session] = await db
.select()
.from(schema.OauthSession)
.where(eq(schema.OauthSession.sessionId, Number(token.payload.jti)));

if (!session) {
return null;
}
if (!session) {
return null;
}

return {
user: session,
};
}),
);
return {
user: session,
};
});

export async function importDpopJwks({
privateJwk,
Expand Down
41 changes: 1 addition & 40 deletions packages/frontpage/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { withSentryConfig } from "@sentry/nextjs";
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
Expand All @@ -12,42 +11,4 @@ const nextConfig = {
},
};

export default withSentryConfig(nextConfig, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: "unravel-xv",
project: "frontpage",

// Only print logs for uploading source maps in CI
silent: !process.env.CI,

// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: true,
},

// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
// tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
});
export default nextConfig;
2 changes: 0 additions & 2 deletions packages/frontpage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.1",
"@sentry/nextjs": "^8.35.0",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"date-fns": "^3.6.0",
"drizzle-orm": "^0.34.1",
"import-in-the-middle": "1.11.2",
"jose": "^5.4.0",
"next": "15.0.0",
"next-themes": "^0.3.0",
Expand Down
16 changes: 0 additions & 16 deletions packages/frontpage/sentry.client.config.ts

This file was deleted.

17 changes: 0 additions & 17 deletions packages/frontpage/sentry.edge.config.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/frontpage/sentry.server.config.ts

This file was deleted.

Loading