Skip to content

0xanshu/project - #93

Merged
SteakFisher merged 33 commits into
ScrawnDotDev:devfrom
0xanshu:0xanshu/project
Jun 30, 2026
Merged

0xanshu/project#93
SteakFisher merged 33 commits into
ScrawnDotDev:devfrom
0xanshu:0xanshu/project

Conversation

@0xanshu

@0xanshu 0xanshu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown

Greptile Summary

This PR scopes checkout sessions by project and updates payment webhook handling around that scope. The main changes are:

  • Session IDs are unique per project instead of globally.
  • Payment webhook session lookup and status updates include projectId.
  • Customer webhook forwarding is awaited after payment status changes.

Confidence Score: 5/5

The checkout-session scoping and webhook updates appear safe to merge.

No concrete correctness issues were identified in the reviewed changes.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex ran the requested verification, but its local artifact references were not uploaded.

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 DELETE /api/v1/internals/projects/:projectId returns 500 for an existing project delete

    • Bug
      • The head handler successfully enters the delete path for an existing onboarded project, but the captured response is HTTP 500 ERROR {} and the structured logger reports InternalError with message PROJECT_NOT_FOUND. This violates the claimed project-management contract that DELETE removes a project’s dependent data and should return a successful deletion response for an existing project, or at minimum map not-found to 404 consistently.
    • Cause
      • In src/routes/http/api/projects.ts, handleDeleteProject relies on throwing PROJECT_NOT_FOUND inside executeInTransaction and only maps it when wrapped as a StorageError with originalError.message === 'PROJECT_NOT_FOUND'. The executed handler surfaced the raw error path as a generic 500. The delete flow also performs multiple dependent deletes before the project delete, making correct not-found detection and error mapping fragile.
    • Fix
      • Update handleDeleteProject to deterministically check project existence before dependent deletes or map both raw Error('PROJECT_NOT_FOUND') and wrapped StorageError forms to 404. Ensure the final project delete result is evaluated without being affected by earlier dependent delete operations, and add an integration/unit test covering successful delete of an existing project and delete of a missing project.

    T-Rex Ran code and verified through T-Rex

Reviews (26): Last reviewed commit: "fix(projects): fixed multiple greptile i..." | Re-trigger Greptile

Comment thread src/zod/internals.ts
Comment thread src/utils/generateInitialAPIKey.ts
@0xanshu

0xanshu commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai we dont need safety checks for the schema yet, safely pass the schema migration checks, and then review everything again

Comment thread src/storage/adapter/postgres/handlers/addBasicUsage.ts Outdated
Comment thread src/routes/http/registerWebhookRoutes.ts
Comment thread src/storage/db/postgres/schema.ts
Comment thread src/storage/db/postgres/schema.ts
Comment thread src/routes/http/api/onboarding.ts
Comment thread src/routes/http/api/onboarding.ts Outdated
Comment thread src/routes/http/api/onboarding.ts
Comment thread src/routes/http/api/registerApiRoutes.ts
Comment thread src/routes/http/api/apiKeys.ts Outdated
Comment thread src/storage/adapter/clickhouse/schema.ts
Comment thread src/utils/parseExpr.ts
Comment thread src/storage/adapter/clickhouse/handlers/priceRequestAiTokenUsage.ts Outdated
Comment thread src/routes/http/api/apiKeys.ts Outdated
Comment thread src/routes/http/api/apiKeys.ts Outdated
Comment thread src/storage/adapter/postgres/handlers/addAiTokenUsage.ts Outdated
Comment thread src/routes/http/api/webhookDeliveries.ts
Comment thread src/storage/db/postgres/schema.ts Outdated
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts
Comment thread src/routes/http/api/projects.ts
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/apiKeys.ts Outdated
Comment thread src/routes/http/api/apiKeys.ts Outdated
Comment thread src/routes/http/api/projects.ts
Comment thread src/storage/db/postgres/helpers/users.ts Outdated
Comment thread src/routes/http/api/tags.ts
Comment thread src/routes/http/api/expressions.ts
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts
Comment thread src/routes/http/api/projects.ts
Comment thread src/routes/http/api/webhookEndpoints.ts
Comment thread src/routes/http/api/webhookEndpoints.ts Outdated
Comment thread src/storage/adapter/postgres/handlers/queryEvents.ts
Comment thread src/storage/adapter/clickhouse/handlers/queryEvents.ts Outdated
@0xanshu

0xanshu commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai full review and reevaluate all your previous comments that may have been dismissed, ignored or resolved. Evaluate whether the goals of the issue linked in the first PR comment are met. Post your conclusion as an easily readable comment that also includes your findings outside the diffs. Tell me your final conclusion on whether this PR is ready for merging, if not ready for merge, mention what are the issues exactly in detail, that are holding it up to a low confidence score.

Comment thread src/routes/http/api/webhookEndpoints.ts
Comment thread src/routes/http/api/projects.ts
Comment thread src/interceptors/auth.ts
Comment thread src/routes/gRPC/auth/createAPIKey.ts
Comment thread src/routes/http/api/apiKeys.ts
Comment thread src/routes/gRPC/data/query.ts Outdated
Comment thread src/routes/gRPC/data/query.ts
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/gRPC/payment/createCheckoutLink.ts Outdated
Comment thread src/storage/db/postgres/helpers/apiKeys.ts
Comment thread src/storage/adapter/clickhouse/schema.ts
Comment thread src/storage/adapter/clickhouse/schema.ts Outdated
Comment thread src/storage/adapter/clickhouse/schema.ts Outdated
Comment thread src/routes/http/api/apiKeys.ts
Comment thread src/routes/http/api/projects.ts Outdated
Comment thread src/routes/http/api/onboarding.ts
Comment thread src/zod/data.ts
Comment thread src/routes/http/api/projects.ts
Comment thread src/storage/db/postgres/schema.ts Outdated
Comment thread src/routes/http/createdCheckout.ts Outdated
Comment thread src/routes/http/createdCheckout.ts Outdated

@SteakFisher SteakFisher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fuck it we ball if you've thoroughly tested it

Comment thread src/routes/gRPC/auth/createAPIKey.ts
Comment thread src/routes/http/api/webhookDeliveries.ts
@SteakFisher
SteakFisher merged commit 3380597 into ScrawnDotDev:dev Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants