I have this job and I'm running into an issue I do not fully understand.
I have this exception:
InvalidOperationException: The previously scheduled job HashDataJob reads from the ComponentTypeHandle<Sim.EventStorageSingleton> HashDataJob.JobData.DynamicComponentHandle. You must call JobHandle.Complete() on the job HashDataJob, before you can write to the ComponentTypeHandle<Sim.EventStorageSingleton> safely.
I thought it'd be due to the DynamicComponentTypeHandle, because I hadn't seen this before when using ComponentTypeHandle. So I wrote a version using ComponentTypeHandle instead (for the EventStorageSingleton only).
The error went away, but I got one for LocalTransform as well. I added a hard-coded version for that as well, and i had no more issues.
Then, I removed the hardcoded versions again, and there errors were gone, until I rebooted Unity (odd, I thought this was deterministic, but alright). Since then, I cannot reproduce the issue for the LocalTransform anymore (I do not understand that at all).
Now, only the exception related to Sim.EventStorageSingleton remains, which I started out with, and at least this I now reproduce this consistently. It is triggered from a CompleteDependencyBeforeRW<Sim.EventStorageSingleton>().
Is the dependency system expected to behave differently with DynamicComponentTypeHandle and ComponentTypeHandle ?