Audited gitgram-ai end to end by actually running the backend against a
live Postgres instance (not just reading/trusting the existing Jest
suite, which mocks Prisma and therefore never hits real FK constraints
or real route wiring).
Critical, feature-breaking bug: Message.senderId/receiverId and
MessageReaction.userId are foreign keys into Account, but every
messaging controller function wrote/read req.userId (a User id) into
those columns directly. Verified live: every message send (1:1 DM and
group chat) failed with a Prisma foreign-key-constraint violation, and
group messages additionally violated the (until now) required
non-null receiverId column since group messages have no single
receiver. Messaging has never worked through this code path. Fixed by
resolving the caller's Account id once per request (matching the
`prisma.account.findFirst({ where: { userId } })` pattern already used
elsewhere in the codebase, e.g. followRequestController) and using it
consistently for every Message/MessageReaction read, write, and
ownership check, while keeping ChatMember/UserBlock/socket rooms on the
real User id they were already consistent with. Added a Prisma
migration making Message.receiverId nullable for group-only messages.
Verified against a live Postgres test database: registered 3 users,
created a group chat, sent and read 1:1 and group messages, reacted,
and marked conversations read -- all succeed now.
Cross-tenant IDOR (same bug class found on Scribase today): GET
/api/v1/messages/chats/:chatId had no membership check at all -- any
authenticated user could read any group chat's messages by chatId
alone (every sibling function in the same file -- getMessage,
reportMessage, assertMessageAccess -- already enforced membership, this
one endpoint was the outlier). Also hardened sendMessage so posting
into a chatId you don't belong to is rejected. Verified live: a
non-member now gets 403 on both reads and writes to a chat they're not
in; an actual member still gets 200.
Unrelated build blocker found while standing up the backend to test
this: gitgram/backend/tsconfig.json set `ignoreDeprecations: "6.0"`,
which the pinned typescript@^5.9.3 doesn't recognize -- `tsc`/`ts-node`
hard-error with TS5103 before compiling a single file. Backend could
not build or boot in dev mode at all. Fixed to "5.0".
SEO gap: gitgram/web (Next.js 14 app dir) had no robots.txt and no
sitemap anywhere, static or dynamic -- zero crawl directives, no
sitemap reference for search engines. Added app/robots.ts (disallows
authenticated-only surfaces, allows public ones) and app/sitemap.ts
(static public marketing/discovery routes).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
DELETE /auth/delete-account threw "User not found" for every OAuth-only
account (any user with no password always failed `!user.password`), and
both the web and mobile clients called /v1/compliance/account and
/compliance/account, routes that never existed - so account deletion
was broken for 100% of users on every surface, not just OAuth.
Password accounts still require re-entering their password; OAuth-only
accounts delete using the authenticated session as proof instead. Web
and mobile now check whether the account has a password before showing
the field, and call the real /auth/delete-account route. Backend keeps
a DELETE /auth/account alias for any already-shipped client builds.
70/70 backend auth tests pass, including 3 new cases for the
OAuth-without-password path and the password-missing/wrong-password
cases.
Three user-facing "export my data" entry points (settings/privacy,
settings/data, backup/export) all called endpoints that never existed on
the backend: /v1/settings/data and /v1/compliance/export-data both 404.
Every click silently failed or showed a fake "queued, check your email"
message with nothing ever sent.
A fully working, real GDPR export pipeline already exists at
/api/v1/data-export (request -> async generate -> poll status -> download),
just never wired to any UI. Added a shared requestAndDownloadDataExport
flow (web/utils/dataExportFlow.ts) that requests the export, polls status
until ready, then streams and downloads the file, and pointed all three
pages plus userService's mismatched getExportStatus (was missing the
required exportId path param) at it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
handleCopyShareLink read graph.profile.username, but graph is TalentGraph|null.
The render-level early return does not narrow graph inside the callback closure,
so tsc reported TS18047 (possibly null) and a null graph would throw at runtime.
Optional-chain the guard so the handler no-ops until the graph has loaded.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The canonical /login and /register already offered GitHub OAuth, but the
legacy /auth screen (reached via router.push('/auth') from insights, drafts,
creator-studio, follow-requests) was email/password only — a GitHub-native
new user landing there had no way in. Add a guarded "Sign in with GitHub"
button that calls githubService.connectGitHub() (redirects to GitHub's
authorize endpoint; /auth/github/callback, already in middleware publicPaths,
completes it). Also drop the emoji from the footer copy per the no-emoji UI
rule while editing this screen.
Test: connectGitHub redirects to the authorize endpoint with the configured
client_id, callback redirect_uri, and user:email,repo,read:user scopes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The recruiter placement/unlock backend was end-to-end (routes,
talentBillingService, Creem checkout + signed webhook settlement) but had
no frontend, so recruiters literally could not pay. This closes the only
fully dead-ended money surface.
Web (gitgram/web):
- talentGraphService: add listUnlocks, requestUnlock (idempotent, optional
placement success-fee), and getCandidateContact mapping the existing
owner-gated backend routes, with typed placement/contact envelopes.
- utils/talentUnlock: pure gating helpers (deriveUnlockState, findPlacement,
interpretUnlockResult, formatFee) so the owner-only logic is unit tested
without rendering.
- talent-network page: owner-only "Unlock candidate" action on each match
card — opens the Creem checkout, reveals contact + full evidence once the
entitlement is paid (poll via "check payment" and on-return via query
params), with not-owner / pending / unlocked / already-unlocked states.
Backend (gitgram/backend):
- talentBillingController: point the checkout successUrl at the real
/talent-network page (with opportunity + unlocked params) instead of a
non-existent /talent/opportunities route, so payment return is not a 404.
Tests: unit-test the three service methods (idempotency header, success-fee
body, already-unlocked, 402-when-unpaid, id encoding) and the gating helper
(not-owner/unlockable/pending/unlocked, checkout-vs-reveal). 21 new tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The backend shipped GET /talent-graph/opportunities/:id/coverage and
talentGapAnalysisService (ARCHITECTURE §3.1 CQ#7 — "which required skills does
the pool cover, and which are unmet gaps?") but no web client consumed it.
Institutions could see top candidates yet not their skill gaps.
- talentGraphService: add getOpportunityCoverage() + NeedCoverageAnalysis,
SkillCoverage, CoverageStrength types mirroring the backend contract.
- talent-network page: fetch coverage alongside matches for the selected
opportunity and render a "Beceri kapsama" panel — per-skill strength badges
(verified/evidenced/interest/unmet), the unmet-skill gap list, coverage ratio
and roll-up status. Coverage is a public read (skill tokens + counts only, no
private free text), so it renders for any viewer of the need.
- CSS: coverage panel styled in the existing Swiss/editorial system.
- tests: web service test for the coverage endpoint (path + shape).
Additive, read-only slice. No backend changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>