re-frame

Ovi Stoica 2026-03-22T13:50:14.861939Z

Posted about this a bit earlier but here is the first published version of re-frame-query: https://clojurians.slack.com/archives/C06MAR553/p1774185679515819

🎉 4
2026-04-07T16:29:00.597549Z

this is a missing piece i've been looking for! here's a question: if I have a polling query that polls at times T0, and will poll again at T1. if T0 query stalls and T1 passes, will it requery? or will it wait for the first query to return and then start the poll timer from T0.1, when the T0 query returns. I have a frequent polling endpoint that sometimes stalls, and I don't want to requery the same query that's already in progress. does that make sense?

Ovi Stoica 2026-04-07T17:27:46.627079Z

Thank you for the kind words 😄 That is an interesting usecase and likely common when you have shorter polling intervals. The current behavior is that the query at T1 will be dispatched regardless if the query at T0 finished or not. Thinking more about it, this is not ideal because if T1 query finishes faster (somehow) than T0, the :query-success event of T0 will overwrite the data from T1 which is bad I'll fix this by making the behavior as you mentioned and adding an option to force refetch on tick if previous poll request is still in flight

🔥 1
🎉 1
Ovi Stoica 2026-04-07T17:37:09.033769Z

Also note that polling happens on an interval, not from the last successful query result. If you have :polling-interval-ms 5000 (every 5 seconds) a poll dispatch will be attempted every 5 seconds not 5 seconds after last successful result. If at T5 you have a request in flight, none will be triggered, then the previous poll request finishes at T7 (no new request or timer is started here), T10 (interval tick 5 seconds from T5) polling dispatches a new request.

👍 1
Ovi Stoica 2026-04-07T18:46:50.077659Z

Fixed and released along with other semi related changes in 0.5.0 see https://github.com/shipclojure/re-frame-query/blob/main/CHANGELOG.md

🚀 1