Skip to content

Conversation

@LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Dec 17, 2025

Description

Resolves ORGS-1027, ORGS-1136

Introduce organization creation defaults to TaskChooseOrganization component - this is based new "Require organization membership" options from the Clerk Dashboard, where C1s can define default organization naming rules

We're also now detecting a default logo based on the user's email domain.

CleanShot.2025-12-19.at.12.32.42.mp4

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features
    • Prefilled organization creation form (name, slug, logo) with optional default-logo auto-upload, in-form avatar controls, advisory warning for existing organizations, loading spinner for logos, and a user-facing API to fetch creation defaults.
  • Documentation
    • Added localization string for existing-organization notification.
  • Tests
    • Added tests for behavior when creation defaults are enabled or disabled.
  • Chores
    • Added related types and fixture helpers to support these features.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 17, 2025

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

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 7, 2026 9:44pm

@LauraBeatris LauraBeatris changed the title feat(ui,clerk-js,shared): Add organization creation defaults to components feat(ui,clerk-js,shared): Surface organization creation defaults to components Dec 17, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

🦋 Changeset detected

Latest commit: 3f86a35

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@clerk/localizations Minor
@clerk/clerk-js Minor
@clerk/shared Minor
@clerk/ui Minor
@clerk/react Patch
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 81ea1f2 to 12005fb Compare December 17, 2025 19:18
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 21f7045 to 7093f4b Compare December 19, 2025 13:52
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch 2 times, most recently from 5393111 to 97c7605 Compare December 19, 2025 14:25
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 97c7605 to c5fcb39 Compare December 19, 2025 14:49
@LauraBeatris LauraBeatris requested a review from a team December 19, 2025 15:27
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 13af5ff to 22edba6 Compare December 19, 2025 15:31
@LauraBeatris LauraBeatris marked this pull request as ready for review December 19, 2025 15:34
actionText: 'Signed in as {{identifier}}',
},
alerts: {
organizationAlreadyExists:
Copy link
Member Author

Choose a reason for hiding this comment

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

Let's also include the company name:

An organization already exists for the detected company name (Clerk) and domain (clerk.dev). Join by invitation

<FormContainer sx={t => ({ padding: `${t.space.$none} ${t.space.$10} ${t.space.$8}` })}>
<Form.Root onSubmit={onSubmit}>
<OrganizationCreationDefaultsAlert organizationCreationDefaults={props.organizationCreationDefaults} />
<OrganizationProfileAvatarUploader
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll make some changes to either add a initial blur while the image is loading, or render a spinner instead of the "remove" button

@LauraBeatris
Copy link
Member Author

I'll try to come back to this one later today, just postponing a bit cause the higher priority is to support the team with remaining items to release another project

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts:
- Around line 63-73: The __internal_toSnapshot method on
OrganizationCreationDefaults currently only serializes advisory and omits the
required form field; update OrganizationCreationDefaults.__internal_toSnapshot
to also include a serialized form property (mirror how advisory is serialized:
map the relevant fields from this.form into the expected
OrganizationCreationDefaultsJSONSnapshot structure) so the returned object
contains both advisory and form, and remove or avoid relying on the unsafe "as
unknown as" mask if possible so the return type properly matches
OrganizationCreationDefaultsJSONSnapshot.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 317e59d and fbbfb30.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/ui/package.json
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/utils/blurhash.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/shared/src/types/organizationCreationDefaults.ts
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/package.json
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/package.json
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/ui/src/utils/blurhash.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/package.json
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/elements/Avatar.tsx
packages/*/package.json

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/*/package.json: Packages should export TypeScript types alongside runtime code
Follow semantic versioning for all packages

All packages must be published under @clerk namespace

packages/*/package.json: Framework packages should depend on @clerk/clerk-js for core functionality
@clerk/shared should be a common dependency for most packages in the monorepo

Files:

  • packages/ui/package.json
**/package.json

📄 CodeRabbit inference engine (.cursor/rules/global.mdc)

Use pnpm as the package manager for this monorepo

Files:

  • packages/ui/package.json
🧬 Code graph analysis (2)
packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (2)
packages/ui/src/elements/AvatarUploader.tsx (1)
  • AvatarUploaderProps (17-23)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts (2)
packages/shared/src/types/organizationCreationDefaults.ts (4)
  • OrganizationCreationDefaultsResource (22-34)
  • OrganizationCreationAdvisoryType (4-4)
  • OrganizationCreationAdvisorySeverity (6-6)
  • OrganizationCreationDefaultsJSON (8-20)
packages/shared/src/types/snapshots.ts (1)
  • OrganizationCreationDefaultsJSONSnapshot (147-147)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
packages/ui/package.json (1)

82-82: No action needed. The blurhash@2.0.5 dependency is valid and has no known security vulnerabilities.

packages/ui/src/elements/OrganizationAvatar.tsx (1)

7-10: LGTM - blurHashPlaceholder prop correctly added and threaded.

The new optional prop is properly typed, documented, and forwarded to the Avatar component.

Also applies to: 13-13, 19-19

packages/ui/src/elements/Avatar.tsx (1)

18-19: LGTM - blurhash placeholder loading logic is sound.

The loading state, placeholder rendering, and fade-in transition are correctly implemented with proper state management and conditional rendering.

Also applies to: 36-36, 39-42, 53-62, 81-87

packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (1)

11-15: LGTM - prop correctly threaded through uploader component.

Also applies to: 17-17, 35-35

packages/ui/src/utils/blurhash.ts (1)

7-31: LGTM - blurhash decoder is well-guarded with comprehensive error handling.

The function safely handles null inputs, errors during decoding, and potential SSR issues by returning undefined on any failure.

Comment on lines +63 to +73
public __internal_toSnapshot(): OrganizationCreationDefaultsJSONSnapshot {
return {
advisory: this.advisory
? {
code: this.advisory.code,
meta: this.advisory.meta,
severity: this.advisory.severity,
}
: null,
} as unknown as OrganizationCreationDefaultsJSONSnapshot;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incomplete snapshot: missing form property.

The __internal_toSnapshot method only serializes advisory but omits form. Per OrganizationCreationDefaultsJSONSnapshot (alias for OrganizationCreationDefaultsJSON), both properties are required. The as unknown as cast at line 72 masks this type error. This will cause incomplete state restoration when snapshots are consumed.

🐛 Proposed fix
   public __internal_toSnapshot(): OrganizationCreationDefaultsJSONSnapshot {
     return {
       advisory: this.advisory
         ? {
             code: this.advisory.code,
             meta: this.advisory.meta,
             severity: this.advisory.severity,
           }
         : null,
-    } as unknown as OrganizationCreationDefaultsJSONSnapshot;
+      form: {
+        name: this.form.name,
+        slug: this.form.slug,
+        logo: this.form.logo,
+        blur_hash: this.form.blurHash,
+      },
+    };
   }
🤖 Prompt for AI Agents
In @packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts around
lines 63 - 73, The __internal_toSnapshot method on OrganizationCreationDefaults
currently only serializes advisory and omits the required form field; update
OrganizationCreationDefaults.__internal_toSnapshot to also include a serialized
form property (mirror how advisory is serialized: map the relevant fields from
this.form into the expected OrganizationCreationDefaultsJSONSnapshot structure)
so the returned object contains both advisory and form, and remove or avoid
relying on the unsafe "as unknown as" mask if possible so the return type
properly matches OrganizationCreationDefaultsJSONSnapshot.

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 6b60da1 to dbdb206 Compare January 7, 2026 14:31
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 1cd23d7 to 9f3591b Compare January 7, 2026 20:57
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 9f3591b to 0532a91 Compare January 7, 2026 20:58
>
{ImgOrFallback}

{isLoading && (
Copy link
Member Author

Choose a reason for hiding this comment

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

CleanShot.2026-01-07.at.17.55.29.mp4

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
@packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx:
- Around line 67-74: Wrap the default logo download logic in a try-catch and
guard HTTP errors: when defaultLogoUrl is used, fetch it and check response.ok
before calling response.blob(), then create the File and call
organization.setLogo({ file: logoFile }); on success; on any fetch/blob/File
error catch it, log the error (but do not rethrow) and allow organization
creation to continue without a logo. Ensure the code path that calls
organization.setLogo remains unchanged for the successful case and that failures
only result in a non-blocking log message.

In @packages/ui/src/elements/Avatar.tsx:
- Around line 63-73: handleImageLoad uses setTimeout to delay setLoaded(true)
which can fire after the component unmounts or imageUrl changes; store the timer
id in a ref (e.g., timeoutRef) instead of relying on useCallback cleanup, assign
the result of setTimeout to timeoutRef.current inside handleImageLoad, and add a
useEffect that watches imageUrl (and on mount/unmount) to
clearTimeout(timeoutRef.current) and reset timeoutRef.current to null so no
stale setLoaded runs after unmount or when imageUrl changes; keep
spinnerShownAtRef and SPINNER_MIN_DURATION_MS logic but ensure timeouts are
cleared before starting a new one.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dbdb206 and 0532a91.

📒 Files selected for processing (20)
  • .changeset/calm-maps-work.md
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/index.ts
  • packages/shared/src/types/localization.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/shared/src/types/organizationSettings.ts
  • packages/shared/src/types/snapshots.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
🚧 Files skipped from review as they are similar to previous changes (12)
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/shared/src/types/snapshots.ts
  • packages/shared/src/types/localization.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/tests/TaskChooseOrganization.test.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/index.ts
  • .changeset/calm-maps-work.md
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
🧬 Code graph analysis (4)
packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (2)
packages/ui/src/elements/AvatarUploader.tsx (1)
  • AvatarUploaderProps (17-23)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (3)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
packages/ui/src/elements/Alert.tsx (1)
  • Alert (13-65)
packages/ui/src/primitives/Text.tsx (1)
  • Text (46-57)
packages/ui/src/elements/OrganizationAvatar.tsx (2)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/ui/src/elements/Avatar.tsx (1)
  • Avatar (25-170)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (2)
packages/react/src/isomorphicClerk.ts (1)
  • user (730-736)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Unit Tests (shared, clerk-js, RQ)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (1)

1-40: No blocking issues found.

The component correctly handles null/undefined advisory data and unknown advisory codes. Type usage aligns with shared definitions.

packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1)

22-59: No blocking issues found.

The conditional fetch logic and prop threading for organization creation defaults are implemented correctly. Loading states are properly aggregated.

Comment on lines +67 to +74
if (file) {
await organization.setLogo({ file });
} else if (defaultLogoUrl) {
const response = await fetch(defaultLogoUrl);
const blob = await response.blob();
const logoFile = new File([blob], 'logo', { type: blob.type });
await organization.setLogo({ file: logoFile });
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing error handling for logo fetch could abort organization creation.

The fetch and blob conversion for defaultLogoUrl has no error handling. Network failures, HTTP errors (404, 403, CORS issues), or blob conversion failures will throw an unhandled exception, preventing organization creation entirely. This blocks merging.

Wrap the fetch/blob/File creation in a try-catch, verify response.ok before calling .blob(), and log errors without blocking organization creation if the logo fetch fails.

🤖 Prompt for AI Agents
In
@packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
around lines 67 - 74, Wrap the default logo download logic in a try-catch and
guard HTTP errors: when defaultLogoUrl is used, fetch it and check response.ok
before calling response.blob(), then create the File and call
organization.setLogo({ file: logoFile }); on success; on any fetch/blob/File
error catch it, log the error (but do not rethrow) and allow organization
creation to continue without a logo. Ensure the code path that calls
organization.setLogo remains unchanged for the successful case and that failures
only result in a non-blocking log message.

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 0532a91 to 3f86a35 Compare January 7, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants