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
Calls to re-render resources while selecting/dragging/resizing leads to error #4817
Comments
Hi there @arshaw, was just wondering if you ever got around to taking a look at this issue? I am still experiencing this, and was hoping to get your feedback on it (whether it's worth fixing, and if so, your estimate on when the fix would go in). Thanks! |
Hi @notajingoist I have not had a chance to dig into it unfortunately. Thank you for the repro link. There are some other more urgent bugs that need fixing in the meantime, but this is on my radar |
Thanks for the clear explanation and diagnosis. I can see why this would be happening. The code is currently not very well set up to rerender anything mid-drag. I understand your usecase here, but can't imagine it is too common, so apologize in advance if this takes a little while to formally address. What I would recommend, if you'd like to get your hands dirty, is to somehow re-generate the coord cache if it happens to be null. It would function as a lazy cache. |
I'm not sure what changed, but I just did a big upgrade of the scheduler (1.2.0 to 1.5.0) and I don't think this issue is relevant anymore. Not sure which release fixed this. See new demo (with upgraded fullcalendar & scheduler): http://jsbin.com/yeyinekoba/1/edit?js,output However, I did notice a new symptom: the This is of course a very minor issue; I was just relying on |
this is no longer an issue: https://codepen.io/arshaw/pen/abdwvON?editable=true&editors=001 |
Hi Adam. Re your comment "no longer an issue", does this assume v5 is in use? |
exactly. i forgot to clarify that. the problem is fixed, only in v5 |
I have run into a bug where calling any method that re-renders resources (
refetchResources
, etc.) while in the middle of performing a selection/drag/resize (at least these) leads to the following error (stack trace included):I think what's happening is that when I re-render, the original
colCoordCache
object is reinitialized in therenderDates
function but the query hits are still happening and so this check for length oncolCoordCache.left
(which is now null) results in this error.The reason this is a problem for me is that I am working with a live-updating asynchronous data model that continuously pushes updates from the server to the client. This means that at any point, I might need to re-render the resources if they change on the server. And because these live updates are unpredictable, they may happen while a user is selecting some part of the scheduler, or dragging/resizing an event.
To work around this, I tried to set a flag to indicate when the scheduler is "busy," i.e. not safe to re-render resources, but the API doesn't include callbacks that fire at the very start of each of these interactions.
eventDragStart
is OK, butselect
andeventResize
don't actually fire until after a selection and resize are completed (mouse click is released), and that is too late. (Although I would rather this bug be fixed than have a change to the API to provide more useful callbacks).I've simulated this bug on jsbin (http://jsbin.com/kavowocufo/edit?js,output) by making a call to
refetchResources
every 1000 milliseconds. Open up the console, and start selecting parts of the scheduler/dragging events/resizing events and observe the above error get logged.The text was updated successfully, but these errors were encountered: