-
Notifications
You must be signed in to change notification settings - Fork 2k
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 issue chaining multiple requests #3385
Conversation
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.
@vincendep sorry, I didn't catch it sooner. any idea what the changes to the package-lock are all about? I'm done for the day today but I'll take a look tomorrow and maybe we can get this merged tomorrow one way or the other. |
mmm no idea what those changes are. I ve only run npm run bootstrap && npm run app-start from the root to test the changes I ve made. (But first time I was using a wrong version of node so I had to run a clean) |
0f99545
to
1c97f8e
Compare
1c97f8e
to
8136d34
Compare
haha, welp. I also nave no idea where those lockfile changes came from. I removed them and ran a bootstrap and they didn't return. /shrug. All the same, I re-tested just to make sure and this seems to be working as expected. Thanks again for contributing! |
thank you too...happy to contribute! |
8136d34
to
d36461b
Compare
ok, sorry to renege, but I would like @develohpanda to take a look at this. There was a test that needed to be updated. I studied it for some time, indeed, and concluded that the change we made to the behavior (to fix the bug) needed to be made to the original, but now I'm worried that there's a potential for a different use-case for recursion that there wasn't before. The test was written in such a way that looks like it is expecting an infinite loop, but now there isn't one. Since I'm not sure and out of an abundance of caution, let's @develohpanda a chance to take a look. |
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.
This looks good to me - I tested some of the recursive scenarios I could think of both on Live and in this PR and they seem to be working as intended. I like the requestChain
approach over the boolean flag.
I think it would be good to add a safety net into the chain, however - so it doesn't grow to an unreasonable amount (maybe hard-coded at 5 or 10?) I am mostly imagining malicious use of it; if someone was to export a workspace online with many (tens, hundreds) of requests chained together, if someone was to import and run a request that would be problematic.
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.
Comment on the test which is worth addressing
since this will be in TypeScript soon, and this was as topical a time as any to make this change.
338fcf8
to
c4b0f25
Compare
* Fix issue chaining multiple requests * refactor: use switch to prepare for leveraging exhaustiveness checking since this will be in TypeScript soon, and this was as topical a time as any to make this change. * fixes failing test with new behavior (and removes unused `fromResponseTag`) * fix tests Co-authored-by: Vincenzo De Petris <[email protected]> Co-authored-by: Dimitri Mitropoulos <[email protected]> Co-authored-by: Opender Singh <[email protected]>
Closes #3382