block end calculation (#1683)

This commit is contained in:
Alex Christoffer Rasmussen
2025-07-13 17:01:21 +02:00
committed by Carlos Valente
parent e811a82be2
commit e9dda817e5
15 changed files with 474 additions and 376 deletions
@@ -771,11 +771,12 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
!deepEqual(RuntimeService.previousState?.runtime, state.runtime);
/**
* the currentBlock object has no ticking values so we only need to check for equality
* the currentBlock object has the potential to tick on expected end
* TODO: the value shows up one tick to late
*/
const shouldBlockUpdate =
!deepEqual(RuntimeService?.previousState.blockNow, state.blockNow) ||
!deepEqual(RuntimeService?.previousState.blockNext, state.blockNext);
RuntimeService?.previousState.blockNext !== state.blockNext;
/**
* Many other values are calculated based on the clock
@@ -806,7 +807,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
batch.add('blockNow', state.blockNow);
batch.add('blockNext', state.blockNext);
RuntimeService.previousState.blockNow = structuredClone(state.blockNow);
RuntimeService.previousState.blockNext = structuredClone(state.blockNext);
RuntimeService.previousState.blockNext = state.blockNext;
}
if (hasImmediateChanges) {