evaera / matter

A modern ECS library for Roblox.
https://eryn.io/matter/
MIT License
146 stars 34 forks source link

Deleting a file with hot reloading enabled causes error #58

Open metrowaii opened 1 year ago

metrowaii commented 1 year ago

If systemA depends on systemB, and systemB gets deleted an error is spammed in the output. The proposed solution is to stop the loop when an error with the scheduling occurs.

image

Ukendio commented 1 year ago

What is the context to this? Why is it being deleted, is it rewire? Rewire should be utilising the loop:rescheduleSystem so this problem shouldn't be happening

metrowaii commented 1 year ago

This was part of a test I was conducting with the new scheduler logic. Imagine the case where you delete a system that another system has a dependency on - when rewire replaces the system, the logic that schedules the systems is called again throwing an error which is what you see in the image. But the errors following the first one are being thrown because the loop is still running even though the scheduling logic failed. The solution here would be to stop the existing loop if an error is thrown by the scheduling. I should note that this is very low priority. I don't think anyone is deleting systems while testing.

Ukendio commented 1 year ago

error is thrown by the scheduling

Yeah this makes sense to me, but I need to read some of the scheduling logic to understand its semantics to make a decision on what we want to do. It has changed quite a bit since last time I had a read half a year ago. Were these issues present before https://github.com/evaera/matter/pull/54 ?

metrowaii commented 1 year ago

I never tested this behavior before my scheduler changes, but I'm fairly confident that this issue was present. The only difference would be the message of the first error that is thrown.