toedter / hal-explorer

An API explorer for RESTful Hypermedia APIs using HAL or HAL-FORMS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Double requests when navigating APIs with HAL explorer

pmoule opened this issue · comments

Hi Kai

When working with HAL explorer, I regulary see double requests in my logs and Network tab in DevTools.

Example
Open HAL Explorer Demo (1.1.1) and open e.g. Chrome's Network tab in DevTools.
Trigger the GET request via GET button for relation hal-movies. You'll see two requests. One after another. As far as I can see both are identical - same behaviour in Firefox.

Same when you e.g paste https://toedter.github.io/hal-explorer/release/hal-explorer/examples/movies.hal.json into the input field and push the Go! button. Two requests visible in Network tab after that. Pushing the Go! button a second time only results in a single request.

My RESTful APIs navigated with HAL explorer regularly show two identical log entries for request. Can you please clarify whether this is intended or a bug.

image

Thanks & best wishes
Patrick

Thanks for reporting this. It seems to be a bug, I will take a look at it asap.

This happened because

  • a click on the Go! button starts a request
  • and changes the hash location to uri=<new URI>
  • that triggered a new request with the same URI

I fixed in explicitely not reacting on a hash location change after doing a request and changing the hash location.

Thanks a lot for providing a fix.
Best wishes