Get Free Trial

Flexmonster gets stuck in a loading state when there’s a delay between the last data and the response itself closing

Alex Gilleran asked on April 23, 2021

We’re finding that if you use Flexmonster to load data from a JSON URL (using type: json, filename: <url>), if there’s a delay of more than 4 seconds or so between the last object being passed down through the response, and the server actually closing the response, Flexmonster gets stuck with the “Loading xKB” modal showing, even after the response is finished and the underlying XmlHttpRequest is complete (readyState === 4) – you can assert this if you wait for the request to finish then dump the javascript heap in Chrome and find the XHR.

I’ve made a reproduction case here: – it uses your JsFiddle example from the docs, but connects to a node js server that demonstrates a contrived but reliable reproduction case of the kind of response I’m talking about – code is here:

The real use case here is that we’re connecting to a JSON service that streams data on the fly out of a mysql database – in big queries, it’s quite possible for the mysql db to find all the data that matches the query at the start of the stream and send that through, but continue paging through the potential result set and find no rows that match, and hence return no objects in the last 4+ seconds of the query before it finishes and closes the stream.

This setup works great for us outside of this problem – unfortunately we didn’t notice it until we’d already gone into production and it started to be noticed by customers, so it’d be good if we could fix it quickly. I think we might be able to work around it by holding onto the last object we see and only sending that down the stream just before the stream closes – unless you can think of a better work around?


4 answers

Mykhailo Halaida Mykhailo Halaida Flexmonster April 23, 2021

Hi Alex,
Thank you for posting your question and preparing a detailed sample.
Our team will investigate this behavior and provide a fix with our upcoming release on ETA May 17th.
In the meantime, the workaround you’ve mentioned sounds reasonable – perhaps try using it until a proper fix is released?
Please let us know if this works for you.
Best regards,

Alex Gilleran April 25, 2021

Great will do, thanks Mykhailo!

Mykhailo Halaida Mykhailo Halaida Flexmonster May 18, 2021

Hi Alex,
Hope you’re doing well!
The issue with getting stuck in a loading state when there’s a gap between the last JSON response and the streaming end was fixed.
This is available in Flexmonster v. 2.8.33:
You are welcome to update the component. Here is our updating to the latest version tutorial for guidance: 
Please let us know if the fix works well for you.
Best regards,

Mykhailo Halaida Mykhailo Halaida Flexmonster May 26, 2021

Hi Alex,
How are you?
Have you already checked out our latest fix? Is everything working well for you?
We’d be happy to hear your feedback.

Please login or Register to Submit Answer