@@ -83,7 +83,11 @@ func (ms *MutableStateImpl) applyFastForward(propagatedTargetTime *timestamppb.T
8383 targetTime = ms .Now ().Add (tsc .GetFastForward ().AsDuration ())
8484 }
8585
86- currentVersionedTransition := ms .CurrentVersionedTransition ()
86+ currentVersionedTransition := & persistencespb.VersionedTransition {
87+ NamespaceFailoverVersion : ms .GetCurrentVersion (),
88+ TransitionCount : ms .NextTransitionCount (),
89+ }
90+
8791 tsi .FastForwardInfo = & persistencespb.FastForwardInfo {
8892 TargetTime : timestamppb .New (targetTime ),
8993 HasReached : false ,
@@ -269,12 +273,27 @@ func NewTimeSkippingInfoUtil(tsi *persistencespb.TimeSkippingInfo) *TimeSkipping
269273 return & TimeSkippingInfoUtil {tsi : tsi }
270274}
271275
276+ // HasPendingFastForward reports whether time skipping is enabled and carries a fast-forward that has
277+ // not yet been reached and has a real (non-zero) target time. A fast-forward on a disabled config is
278+ // not "pending" because it can never fire. All accesses go through nil-safe proto getters, so a nil
279+ // util, nil info, nil config, or nil fast-forward all yield false.
272280func (util * TimeSkippingInfoUtil ) HasPendingFastForward () bool {
273- return util .tsi != nil && util .tsi .GetFastForwardInfo () != nil && ! util .tsi .GetFastForwardInfo ().GetHasReached () &&
274- util .tsi .GetFastForwardInfo ().GetTargetTime () != nil && ! util .tsi .GetFastForwardInfo ().GetTargetTime ().AsTime ().IsZero ()
281+ if util == nil || ! util .IsEnabled () {
282+ return false
283+ }
284+ ff := util .tsi .GetFastForwardInfo ()
285+ return ff != nil &&
286+ ! ff .GetHasReached () &&
287+ ff .GetTargetTime () != nil &&
288+ ! ff .GetTargetTime ().AsTime ().IsZero ()
275289}
276290
291+ // IsEnabled reports whether time skipping is enabled. Nil-safe: a nil util, nil info, or nil config
292+ // all yield false.
277293func (util * TimeSkippingInfoUtil ) IsEnabled () bool {
294+ if util == nil {
295+ return false
296+ }
278297 return util .tsi .GetConfig ().GetEnabled ()
279298}
280299
0 commit comments