Here’s the issue as best as I can describe, and I’d love some input on what might be causing it as well as any general “red flags” folks might notice (aside from this fetchData task being Really Long and a good candidate for refactoring).
(Note: I use e-concurrency decorators here,
@restartableTask is what it sounds like in the EC API).
Context: We need “append-based” pagination - you click a button at the bottom of the list, it appends more to the result set. The snippet below is how I’ve accomplished that:
My problem is that when I QUICKLY change a filter by clicking it over and over (which triggers the restartable task to fetch new data), the view falls out sync, specifically the response body’s “meta” object and the store:
I’m not quite sure what’s going on here. What we should be seeing in the view above is no results, but somehow an older response in the task is saved somewhere.
Perhaps it’s that I’m returning a POJO and there’s memory leaking somewhere? Or I’m mixing up synchronous and asynchronous functions (I guess
unloadAll are synchronous, sorry if that’s completely wrong)?
Thank you for any thoughts!