Skip to content

fix(invites): remove uuid validation from inv api - #1910

Merged
aadamgough merged 1 commit into
stagingfrom
fix/perms
Nov 12, 2025
Merged

fix(invites): remove uuid validation from inv api#1910
aadamgough merged 1 commit into
stagingfrom
fix/perms

Conversation

@aadamgough

@aadamgoughaadamgough commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

Summary

  • remove uuid validation from inv api that was causing errors when switching permissions
  • remove uuid validation from billed user id api for the same reason

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Nov 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedNov 12, 2025 2:16am

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Removed UUID validation from the userId field in the workspace permissions API schema.

  • Changed z.string().uuid() to z.string() in updatePermissionsSchema
  • Allows non-UUID user IDs from OAuth providers (GitHub, Wealthbox, Supabase, Slack, etc.) to update workspace permissions
  • Database schema uses text type for user IDs, not UUID type, supporting various ID formats

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change correctly aligns validation with the actual data model. User IDs in the system can come from various OAuth providers and are stored as text, not UUIDs. The overly restrictive UUID validation was causing legitimate requests to fail.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/api/workspaces/[id]/permissions/route.ts5/5Removed UUID validation from userId field in updatePermissionsSchema - correctly reflects that user IDs can be non-UUID strings from OAuth providers

Sequence Diagram

sequenceDiagram
participant Client
participant API as PATCH /api/workspaces/[id]/permissions
participant Zod as updatePermissionsSchema
participant DB as Database
Client->>API: PATCH with {updates: [{userId, permissions}]}
API->>API: Check session auth
API->>API: Verify admin access
API->>Zod: Parse request body
Note over Zod: userId: z.string()<br/>(Previously: z.string().uuid())
Zod->>API: Validated data
API->>DB: Check workspace exists
API->>API: Validate self-update & billing user
API->>DB: Transaction: delete old permissions
API->>DB: Transaction: insert new permissions
DB->>API: Success
API->>Client: Updated permissions list
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@aadamgough
aadamgough merged commit 1d58fdf into stagingNov 12, 2025
4 checks passed
@aadamgough
aadamgough deleted the fix/perms branch November 12, 2025 02:16
@waleedlatif1waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
Sign up for freeto 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.

1 participant

@aadamgough