Conversation
|
|
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Pull request overview
Fixes an SSO-login edge case where creating a default tenant could trigger createCollection with missing optional fields, causing pg-promise named-parameter formatting to throw and bubble up as an auth failure.
Changes:
- Ensure
logoUrl,imageUrl, andcolorparameters are always present (defaulting tonull) when inserting a collection. - Pass the normalized insert params object to the pg-promise query instead of the raw
collectioninput.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |

Problem
When a new user logged in via SSO on a fresh database, the auth flow would create
a default tenant and trigger
createProjectGroup, which internally calledcreateCollectionwithoutlogoUrl,imageUrl, andcolorfields. Since theSQL query referenced those parameters via pg-promise's
$(field)syntax, theirabsence caused pg-promise to throw, propagating the error all the way up to
ssoCallback.tswhere it was caught and returned as a 401.The issue was invisible in staging/prod because existing users already have a
tenant, so the
createCollectioncode path is never hit on login.Fix
Added explicit
nulldefaults forlogoUrl,imageUrl, andcolorbeforepassing the data object to the pg-promise query, so all expected parameters are
always present.
Note
Low Risk
Low risk, localized change to the
createCollectioninsert parameters to avoid pg-promise missing-parameter errors; main impact is that omitted optional fields now persist as explicitNULL.Overview
Fixes
createCollectionso inserts no longer fail when optional fields are omitted.createCollectionnow builds adataobject that pre-fillsdescription,slug,logoUrl,imageUrl, andcolorwithnullbefore spreading the providedcollection, ensuring all$(...)SQL parameters are always present for pg-promise.Written by Cursor Bugbot for commit 29fdcd2. This will update automatically on new commits. Configure here.