fix: keep cancelled initial queries retryable - #5
Conversation
|
@ovistoica this one was short so I opened PR :) |
c438503 to
e464fbb
Compare
| (h/process-event [:re-frame.query/cancel-query | ||
| :patients/page {:page 1}]) | ||
| (let [query (query-entry qid)] | ||
| (is (= :loading (:status query))) |
There was a problem hiding this comment.
Status :loading is misleading here since we canceled the request. It should return to :idle if there wasn't any finished request to begin with. the status is used to show loading states so if we cancel a req but then still show spinners, that would be confusing
This isn't a problem with your PR. I omitted this in the initial impl. You can add this too. This can be a new pure function that gives you the next query-state
|
@jramosg Just checking if you are able to make the changes I have requested here |
|
Sure, I'll commit it early today. Sorry I missed the comments last week and I just read them 🙏 |
ef75eca to
f8552ae
Compare
Add compute-cancelled-status to determine the correct status after cancelling a query: if the query was :loading (no prior success), revert to :idle. Queries with a prior success or error retain their finished status.
f8552ae to
fb3471a
Compare
|
@ovistoica changes pushed, sorry for missing these last week. |
39b3c16 to
0d4db1d
Compare
|
Merged! Thank you! |
fixes #4