[Prototype] Offline: Add batchId to batch metadata to detect forked containers
Description
This is a quick and dirty prototype looking at how we can use stable batchId on each submitted batch to detect forked containers, in the case where a user allows two forks (from the serialization point) to both connect after that point. In these cases, the second container closes as soon as it sees a matching op (batch) from another client come in.
The format of the batch ID is [original client ID, original CSN]. This ID is only assigned on resubmit, since if we find a collision with the original connection/submission, we can compute that ID on the fly.
This also covers the race condition where two forks connect and submit corresponding batches in parallel. The "loser" between the two will close, and all containers processing that range where duplicate ops were submitted will realize it and no-op on the second op. This window closes when the MSN moves past the sequenceNumber of the winner - any client with a duplicate op locally that had RefSeq past that point will never submit the duplicate op.
Reviewer Guidance
Note the changes at the bottom of stashedOps.spec.ts (the "Prototype tests for Offline Phase 3 - serializing without closing" describe block), which demonstrate this is working as expected/required.
Aww way to steal my thunder, microsoft-github-policy-service!! This prototype PR is defunct now, all the behavior has been implemented properly in main 💪