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

feat: Automatically get explained response if URL can be provided #207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikromen
Copy link
Member

(if query-url
(do
(send)
(loading-screen "Getting a response from the server"))
Copy link
Member

Choose a reason for hiding this comment

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

Did you try this with an actual https://github.com/fedora-copr/logdetective ? I haven't yet, but my suspicion is that this will show the "Getting a response from the server" line forever. The query-url will be defined even after we receive the data from the server, so we will go back here, instead of going to the else branch (the whole cond expression).

Copy link
Member

Choose a reason for hiding this comment

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

Still haven't tried with the actual logdetective service, but I think I am right. The send function defines these two handlers:

:error-handler
(fn [error]
(handle-backend-error
(:error (:response error))
(:description (:response error))))
:handler
(fn [data]
(if (m/validate InputSchema data)
(do
(reset! status "ok")
(reset! form data))
(handle-backend-error
"Invalid data"
"Got invalid data from the backend. This is likely a bug.")))))

If you put (js/console.log "Hello") or (js/alert "Hello") in them, you can see that the response handled almost immediately (in my case) but the page still shows "Getting a response from the server"

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.

2 participants