Skip to content

Confluent client unexpectedly mutates function arguments #61

@justjake

Description

@justjake

The KafkaJS consumer unexpected mutates the inputs to some of its methods. For example, kafkaJSClient.pause(topics) will mutate the input topics by adding the .partitions key if it's undefined. I generally expect that Javascript functions treat their inputs as immutable, so I don't need to defensively clone function arguments before passing them to a library. Mutation can lead to unexpected results.

In this case, I want to call .pause(assignments) during the rebalance callback for some assignments. This is mutating the assignment objects, leading to unexpected side effects in the assignment logic.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixed-present-in-next-releaseBug or improvement that's done, it is in the development branch but yet unreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions