For subscribe all you track using the dual positions of commit and prepare. If you prefer take a look at dev branch… It’s about to be moved to master and has a durable subscription included in the client API which would avoid you having to write this code.
Sorry I dont have access to a machine right now but both James and I have gists of dispatchers that should lead you in the right direction. My github is pdoh00. James’s is prob jen20. Andrii may have a gist too
The method of tracking position for a subscription to all is, as Greg says, via a pair of numbers which represent Commit and Prepare positions. This is different to subscribing to an individual stream where the sequence number suffices.