848
allowResetWithPendingChildren bool,
849
childrenInitializedAfterReset map[string]*persistencespb.ResetChildInfo,
851
>
852
>
// TODO change this logic to fetching all workflow [baseWorkflow, currentWorkflow]
853
>
// from visibility for better coverage of events eligible for re-application.
854
>
// after the above change, this API do not have to return the continue as new run ID
855
>
856
>
iter := collection.NewPagingIterator(r.getPaginationFn(
857
>
ctx,
858
>
firstEventID,
859
>
nextEventID,
860
>
branchToken,
861
>
))
862
>
863
>
var nextRunID string
864
>
var lastEvents []*historypb.HistoryEvent
865
>
866
>
for iter.HasNext() {
867
>
batch, err := iter.Next()
868
>
if err != nil {
869
return "", err
870
}
872
>
if _, err := r.reapplyEvents(ctx, mutableState, lastEvents, resetReapplyExcludeTypes); err != nil {
873
return "", err
874
}