Repository navigation
fix(api): enrol the dev session user in the workspace - #194
Closed
phanlemanh wants to merge 1 commit into
Closed
phanlemanh wants to merge 1 commit into
phanlemanh wants to merge 1 commit into
Conversation
dev-session writes the session row straight through Prisma, so better-auth's session.create.before hook never runs and the user never gets a member row. Every workspace-scoped call then answers 'You are not a member of this workspace' — the connections page 500s on it. Call the same helper the hook calls, and carry activeOrganizationId the way it does.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@phanlemanh is attempting to deploy a commit to the Comp AI - PoC Team on Vercel. A member of the Team first needs to authorize it. |
snayyar00
added a commit
to snayyar00/crm
that referenced
this pull request
Sep 16, 2026
Contributor
|
This branch is stale against current main. PR #249 replaces it with current subpath imports, failure handling, workspace enrolment, and one-click browser login. |
snayyar00
added a commit
to snayyar00/crm
that referenced
this pull request
Nov 3, 2026
Takes upstream as the base for every file the fork only carried as an early copy of an upstream PR (trycompai#142, trycompai#194, trycompai#212, trycompai#213, trycompai#216, trycompai#219, trycompai#221), then re-applies the fork's own changes on top: - obligations: completing a RECHECK_DUE task spawns the next re-check inside the same transaction (new spec covers spawn, re-open, deliverable) - deals: winning a deal asks for the engagement type - auth: forced Google consent kept; hd hint withheld when several sign-in domains are allowed (spec added); primaryWorkspaceDomain back to upstream - nav: Calendar and Crons & Syncs re-homed into the Neo workspace nav - brand: WebAbility strings re-applied to upstream copies - agent: document agent ported to eve 0.69 (sandbox + dynamic model) - docker: bun 1.4.0 to match the pinned packageManager and new lockfile Removes leftover take files the upstream versions replaced (csv-parse, task-window, viewer-day, task-edit.spec). check-types 15/15, lint 11/11, lint:slop clean, app build ok, tests: api 447, agent 416, app 260, auth 69, db 115, telemetry 61, mcp 12, env 17, validation 8 (0 fail, 0 skip).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bun run dev:session [email protected]mints a session that the app then rejects with"You are not a member of this workspace." — the connections page 500s on it, and so
does anything else workspace-scoped.
The script writes the session row straight through Prisma, so better-auth's
session.create.beforehook never runs, and that hook is what callsensureWorkspaceMembership. A brand-new dev user therefore never gets amemberrow.It only looks like it works on a workspace that still has zero members, where the
backfill branch enrols everyone who already exists.
Two lines: call the same helper the hook calls, and carry
activeOrganizationIdthesame way it does.
Summary by cubic
Fixes dev sessions so
bun run dev:sessionmints sessions the app accepts. The script wrote session rows directly through Prisma, skipping thesession.create.beforehook that callsensureWorkspaceMembership, so new dev users were never enrolled in a workspace and workspace-scoped calls rejected them with "You are not a member of this workspace." The script now calls the same helper and setsactiveOrganizationIdthe same way the hook does.Written for commit 1c47c66. Summary will update on new commits.