Lagom groupedWithin Flow subscription

This question is somewhat similar to Inconsistency with subscriber service and parallelism levels).

I recently used “groupedWithin” in my topic subscription flow and noticed that when I restarted the service, almost every event is replayed. I read that in the documentation for atLeastOnce (( that the flow should emit one Done per (incoming) event which I am doing in the code below. Would this code satisfy that requirement or is it incorrect? Given the unusual event replay behavior I would assume the latter but can’t be sure.


.groupedWithin(batchSize, duration)
      .mapAsync(1) {
        case evs: Seq[Event] =>
          Future(f(evs)).map(_ => Seq.fill(evs.length)(Done.done()))
        case _ =>