Skip to content
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

fix: correct typo in SSM package. #640

Merged
merged 1 commit into from
Apr 7, 2021
Merged

fix: correct typo in SSM package. #640

merged 1 commit into from
Apr 7, 2021

Conversation

garnertb
Copy link
Contributor

@garnertb garnertb commented Apr 7, 2021

What does this implement/fix? Explain your changes.

Infinite loop in @middy/ssm caused by typo recursion logic.

Does this close any currently open issues?

No.

Any relevant logs, error output, etc?

fetchPath would infinitely iterate when there were > 10 parameters because the nextToken was undefined. Below is a test case with 11 parameters.

//const fetchPath = (path, nextToken, values = {}) => {
fetchPath i:0, nextToken: undefined, values length: 0
fetchPath i:1, nextToken: undefined, values length: 10
fetchPath i:2, nextToken: undefined, values length: 10
fetchPath i:3, nextToken: undefined, values length: 10
...

After:

fetchPath i:0, nextToken: undefined, values length: 0
fetchPath i:1, nextToken: <token value>, values length: 10
done.

@willfarrell willfarrell merged commit 9153c44 into middyjs:main Apr 7, 2021
@willfarrell
Copy link
Member

Thanks for the PR and good catch! I'll put a release together this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants