Stale request URL is used if request is initiated immediately after updating URL
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
### Expected Behavior
When a request's URL is updated by the user, subsequent requests should always be made to the latest URL that was entered - even if the request was initiated immediately after updating the request URL.
### Actual Behavior
When initiating a request immediately after updating the request URL field, the request is made to the old URL rather than the new URL specified.
Screen recording below. I have enabled the onscreen keyboard for this recording so that my keypress timing is easier to see.
https://github.com/Kong/insomnia/assets/97171505/5bbb6e3e-53fe-4665-8f5a-d8d7fe0bf774
### Reproduction Steps
1. Create a new request with any HTTP method (GET, for example)
2. Enter **https://example.com/foo** as the request URL
3. Send the request and review the Timeline tab to verify which URL the request was ultimately made to
4. Update the request URL field value to **https://example.com/foobar** and press enter **_immediately_** after typing the last character
5. Observe the Timeline tab - it will indicate that this second request was still sent to the old URL (**https://example.com/foo**)
### Is there an existing issue for this?
- [x] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.
### Additional Information
Appears to be timing-related; this bug also occurs if the user pastes a whole new URL in, replacing the previous one that was there. While it may sound like a minor edge case, this actually occurs quite often during day-to-day use and is frustrating because it's usually not immediately obvious that the request was made to the wrong URL.
Occurs in latest version, however I've been experiencing this issue since at least before version **2022.7.5**.
### Insomnia Version
2023.2.0
### What operating system are you using?
macOS
### Operating System Version
Ventura - 13.2.1
### Installation method
Downloaded from insomnia.rest
### Last Known Working Insomnia version
_No response_
Contributor guide
Research direction
Reproduce the issue by editing the request URL and pressing Enter immediately, then inspect the Timeline tab to compare the sent URL with the latest field value. Trace the URL field update through the request dispatch path and add or update coverage for immediate typing and paste changes. Done means requests consistently use the newest URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100