Skip to content

fix: remove dead assignment of void return in handleDeployment (closes #133)#137

Open
Rohitbhise0004 wants to merge 1 commit intometacall:masterfrom
Rohitbhise0004:fix/issue-133-dead-assignment
Open

fix: remove dead assignment of void return in handleDeployment (closes #133)#137
Rohitbhise0004 wants to merge 1 commit intometacall:masterfrom
Rohitbhise0004:fix/issue-133-dead-assignment

Conversation

@Rohitbhise0004
Copy link
Copy Markdown

What this PR does
In
src/worker/index.ts
, the
handleDeployment
function incorrectly assigned the return value of
createMetacallJsonFiles()
to a const jsonPaths variable. Since
createMetacallJsonFiles
returns Promise, this assignment always resolves to undefined. The real jsonPaths is correctly computed two lines later via findMetaCallJsons(filesPaths). This PR removes the dead assignment to eliminate confusion and prevent future regressions.

Why this matters
This dead assignment is misleading — it suggests
createMetacallJsonFiles
returns paths, when it actually returns nothing. Removing it makes the data flow through
handleDeployment
clear and prevents a potential bug if someone later tries to use the shadowed jsonPaths variable.

Related issue
Closes #133

Changes
src/worker/index.ts
— Removed the dead const jsonPaths = assignment on the await createMetacallJsonFiles(...) call in
handleDeployment()
. The function returns Promise, so the assignment captured undefined. The real jsonPaths is computed correctly via findMetaCallJsons(filesPaths) on the subsequent line.
How to test
git clone https://github.com/metacall/faas && npm install
docker compose build && docker compose up test && docker compose down
All tests pass — the deployment flow exercises
handleDeployment
end-to-end.
Notes for reviewers
This is a one-line change (removing const jsonPaths = from a void-returning call).
No behavioral change — the code already worked because the real jsonPaths was computed on the next line via findMetaCallJsons.
The /* eslint-disable */ at the top of
worker/index.ts
is pre-existing; cleaning it up is tracked separately.

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.

Bug: createMetacallJsonFiles return value incorrectly assigned to jsonPaths variable

1 participant