fix: remove dead assignment of void return in handleDeployment (closes #133)#137
Open
Rohitbhise0004 wants to merge 1 commit intometacall:masterfrom
Open
fix: remove dead assignment of void return in handleDeployment (closes #133)#137Rohitbhise0004 wants to merge 1 commit intometacall:masterfrom
Rohitbhise0004 wants to merge 1 commit intometacall:masterfrom
Conversation
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.
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.