feat(testing): implement ResetConsumer methods on SyncJetStream - #27
Merged
Conversation
nats.go v1.52.0 added ResetConsumer and ResetConsumerToSequence to the jetstream.JetStream interface. Without stubs SyncJetStream no longer satisfies the interface, breaking any consumer that pulls in both nats.go v1.52+ and go-outbox/testing (e.g. iam-api). Both stubs return "not implemented", matching the rest of the unused-method stubs in this file. Bump nats.go to v1.52.0 to pick up the interface change so the build assertion stays accurate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
ResetConsumerandResetConsumerToSequencestubs toSyncJetStreamso it satisfies the updatedjetstream.JetStreaminterface.nats.godirect dep tov1.52.0(the version that introduced the new interface methods).Why
nats.go v1.52.0 grew the
jetstream.JetStreaminterface with two new methods. Without these stubsvar _ jetstream.JetStream = (*SyncJetStream)(nil)fails to compile in any project that pulls in nats.go v1.52+ alongsidego-outbox/testing— for example, iam-api hit this in CI when its messagebus bump transitively required nats.go v1.52.The new methods follow the same
return "not implemented"shape as the existing unused stubs (Consumer,DeleteConsumer,AccountInfo, etc.), since the synchronous test harness has no concept of consumer reset.Test plan
go build ./...cleango test ./testing/...passes