diff --git a/apps/web/src/app/(app)/[owner]/page.tsx b/apps/web/src/app/(app)/[owner]/page.tsx index 212a83e..e752661 100644 --- a/apps/web/src/app/(app)/[owner]/page.tsx +++ b/apps/web/src/app/(app)/[owner]/page.tsx @@ -9,35 +9,6 @@ import { } from "@/lib/github"; import { OrgDetailContent } from "@/components/orgs/org-detail-content"; import { UserProfileContent } from "@/components/users/user-profile-content"; -import { ExternalLink, User } from "lucide-react"; - -function UnknownAccountPage({ name }: { name: string }) { - const githubUrl = `https://github.com/${encodeURIComponent(name)}`; - - return ( -
-
- -
-
-

{name}

-

- This account can't be viewed here. It may be a bot, - app, or mannequin account. -

-
- - - View on GitHub - -
- ); -} export default async function OwnerPage({ params }: { params: Promise<{ owner: string }> }) { const { owner } = await params; diff --git a/apps/web/src/components/dashboard/contribution-chart.tsx b/apps/web/src/components/dashboard/contribution-chart.tsx index 1308cd1..9c813a2 100644 --- a/apps/web/src/components/dashboard/contribution-chart.tsx +++ b/apps/web/src/components/dashboard/contribution-chart.tsx @@ -133,7 +133,7 @@ export function ContributionChart({ data }: { data: ContributionData }) {
{/* Day labels column */} diff --git a/apps/web/src/components/users/user-profile-content.tsx b/apps/web/src/components/users/user-profile-content.tsx index 8b914db..32a1d32 100644 --- a/apps/web/src/components/users/user-profile-content.tsx +++ b/apps/web/src/components/users/user-profile-content.tsx @@ -333,7 +333,7 @@ export function UserProfileContent({ {/* Language distribution */} {languageDistribution.length > 0 && ( -
+

Languages

diff --git a/apps/web/src/lib/github.ts b/apps/web/src/lib/github.ts index af52c54..ad314ed 100644 --- a/apps/web/src/lib/github.ts +++ b/apps/web/src/lib/github.ts @@ -1,7 +1,7 @@ import { Octokit } from "@octokit/rest"; import { headers } from "next/headers"; import { cache } from "react"; -import { $Session, auth, getServerSession } from "./auth"; +import { $Session, getServerSession } from "./auth"; import { claimDueGithubSyncJobs, deleteGithubCacheByPrefix, @@ -16,7 +16,6 @@ import { upsertSharedCacheEntry, } from "./github-sync-store"; import { redis } from "./redis"; -import { all } from "better-all"; import { computeContributorScore } from "./contributor-score"; import { getCachedAuthorDossier, setCachedAuthorDossier } from "./repo-data-cache"; @@ -573,8 +572,13 @@ async function fetchUserOrgsFromGitHub(octokit: Octokit, perPage: number) { } async function fetchOrgFromGitHub(octokit: Octokit, org: string) { - const { data } = await octokit.orgs.get({ org }); - return data; + try { + const { data } = await octokit.orgs.get({ org }); + return data; + } catch (error) { + // 404 + return null; + } } async function fetchOrgReposFromGitHub( @@ -1006,11 +1010,7 @@ async function upsertCacheWithShared( } } -async function touchCacheWithShared( - userId: string, - cacheKey: string, - cacheType: string, -) { +async function touchCacheWithShared(userId: string, cacheKey: string, cacheType: string) { await touchGithubCacheEntrySyncedAt(userId, cacheKey); if (isShareableCacheType(cacheType)) { touchSharedCacheEntrySyncedAt(cacheKey).catch(() => {}); @@ -1372,7 +1372,11 @@ async function processGitDataSyncJob( rdCached?.etag ?? null, ); if (rdRes.notModified) { - await touchCacheWithShared(authCtx.userId, rdKey, "repo_readme"); + await touchCacheWithShared( + authCtx.userId, + rdKey, + "repo_readme", + ); } else { const rdData = rdRes.data as { content: string; @@ -1737,7 +1741,13 @@ async function readLocalFirstGitData({ if (shareable) { const shared = await getSharedCacheEntry(cacheKey); if (shared) { - upsertGithubCacheEntry(authCtx.userId, cacheKey, cacheType, shared.data, shared.etag).catch(() => {}); + upsertGithubCacheEntry( + authCtx.userId, + cacheKey, + cacheType, + shared.data, + shared.etag, + ).catch(() => {}); await enqueueGitDataSync(authCtx, jobType, cacheKey, jobPayload); return shared.data; }