Persist stream-write updates across reconnects in Rust and Go SDKs #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Summary
This PR fixes a subtle bug in the Rust and Go LaserStream SDKs where stream-write updates were not persisted across reconnects.
Previously:
The SDKs cached the initial SubscribeRequest and reused it on every reconnect.
write / StreamHandle::write only sent updates to the live stream, without updating that cached request.
After a disconnect + reconnect, the client silently reverted to the original subscription, dropping all stream-write changes.
What I changed
Rust (rust/src/client.rs)
Added a small helper merge_subscribe_requests(...) that:
Merges new filters (accounts, slots, txs, blocks, etc.) into the cached SubscribeRequest.
Updates commitment and from_slot when present.
Preserves the internal slot subscription used for replay.
In subscribe, when we receive a write via write_rx.recv():
We now call merge_subscribe_requests(&mut current_request, &write_request, ...) before forwarding it to the stream.
Reconnects now use the latest merged subscription, not just the initial one.
Go (go/laserstream.go)
Added mergeSubscribeRequests(base, update, internalSlotID) with similar behavior to Rust.
In Client.Write:
We now merge req into c.originalRequest while keeping the internal slot tracker.
Then we send req on writeChan as before.
On reconnect, connectAndStream reuses c.originalRequest, which now reflects all stream-write updates.
Behavior after this PR
Stream-write updates (new filters, commitment changes, from_slot updates, etc.) persist across reconnects in both Rust and Go SDKs.
Existing replay behavior (fork-safe from_slot, internal slot tracking) is preserved.