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

[INS-1789] Fix issue preventing selection of custom HTTP methods #5086

Conversation

filfreire
Copy link
Member

@filfreire filfreire commented Aug 16, 2022

changelog(Fixes): Fixed an issue that prevented choosing and deleting user-created custom HTTP methods

Closes INS-1789
Closes #5083

This PR fixes two regressions:

  • A user couldn't select an existing Custom HTTP method;
  • A user couldn't delete more than one HTTP method at a time, needing to close and reopen the custom-methods dialogue.

These issues seem to have spawned from two problems:

  • We returned early when trying to pick a custom method that already existed
  • Relying on recent and setRecent doesn't seem to do what we think it does, and is only "valid for one change", hence why I edited the addition and deletion to rely on localStorage instead. I'm open to suggestions on how to improve this, it felt like a hacky workaround, but I couldn't find another way to make it work due to setRecent not working "a second time in a row" for the same time the modal is open.

⚠️ this PR doesn't solve a problem that we had before in earlier versions of Insomnia - where if we press Enter on the Custom Method modal, it is not seemingly picked up like pressing the Done button.

@filfreire filfreire requested a review from a team August 16, 2022 14:26
Copy link
Contributor

@jackkav jackkav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@DMarby DMarby enabled auto-merge (squash) August 17, 2022 10:20
@DMarby DMarby merged commit 2b23d68 into Kong:develop Aug 17, 2022
@filfreire filfreire deleted the feature/ins-1789-cannot-select-previously-created-custom branch October 11, 2022 13:03
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.

Changes in custom method are not applied
3 participants