Skip to content

fix: incorrect error handling in org id default function #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PeterSchafer
Copy link
Contributor

No description provided.

@PeterSchafer PeterSchafer requested review from a team as code owners August 6, 2025 17:00
Copy link

snyk-io bot commented Aug 6, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

Copy link

snyk-io bot commented Aug 6, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Error Swallowing in `defaultFuncOrganizationSlug`

The defaultFuncOrganizationSlug function incorrectly swallows errors. It logs internal errors (e.g., from API calls like GetSlugFromOrgId()) but then returns nil instead of propagating them. This behavior is inconsistent with defaultFuncOrganization (which was recently fixed to propagate errors) and prevents ORGANIZATION_SLUG from returning an error via GetStringWithError when expected. This causes Test_initConfiguration_failDefaultOrgLookup to fail.

pkg/app/app_test.go#L198-L201

actualOrgSlug, slugError := config.GetStringWithError(configuration.ORGANIZATION_SLUG)
assert.Error(t, slugError)
assert.Empty(t, actualOrgSlug)

pkg/app/app.go#L44-L48

return slugName, nil
}
return callback
}

Fix in Cursor Fix in Web

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.

1 participant