-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(sdk): resolve ReferenceError in envvars.update outside task conte… #4265
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Missing changeset for public package modification The AGENTS.md requires adding a changeset when modifying any public package ( Was this helpful? React with 👍 or 👎 to provide feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Pre-existing bug in the task-context branch assigns slug to projectRef
When
taskContext.ctxis truthy andslugOrParamsis a string (the 5-arg overload path), line 308 sets$projectRef = slugOrParamsinstead of$projectRef = projectRefOrName. This means the slug value gets used as the project reference. Line 309 then sets$slug = slugOrParams ?? taskContext.ctx.environment.slugwhich is correct in value but the??is dead code sinceslugOrParamsis already confirmed to be a string (and thus truthy) by thetypeofcheck on line 307.This means that calling
envvars.update("proj_ref", "dev", "MY_VAR", { value: "x" })from inside a task context would send the API request with projectRef="dev" and slug="dev" instead of projectRef="proj_ref" and slug="dev". The PR fixes the analogous issue in the else branch but leaves this bug untouched.(Refers to lines 308-309)
Was this helpful? React with 👍 or 👎 to provide feedback.