Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mds-stream] [mds-agency] Add missing return statement for kafka writes #336

Merged
merged 1 commit into from
May 19, 2020

Conversation

avatarneil
Copy link

@avatarneil avatarneil commented May 19, 2020

📚 Purpose

There's a bug in the logic that results in a write always falling through to throwing a ClientDisconnectedError. FWIW, we probably ought to not be returning a Promise for writes, but we can revisit that another time.

📦 Impacts:

mds-stream
mds-agency

Copy link

@macsj200 macsj200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine

Copy link

@mdurling mdurling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, but your fix should resolve the issue

@@ -65,6 +65,7 @@ export const KafkaStreamProducer = <TMessage>(
topic,
messages
})
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry that the return will be easy to accidentally remove. Maybe move the test/throw to the top of the method?

if (!isDefined(producer)) {
  throw new ClientDisconnectedError(ExceptionMessages.INITIALIZE_CLIENT_MESSAGE)
}
...

@avatarneil avatarneil merged commit 77ea628 into develop May 19, 2020
@avatarneil avatarneil deleted the bugfix/neil/fix-kafka-producer-writes branch May 19, 2020 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants