fix(connect): handle null value sections in connector config validation#2485
Open
isliao613 wants to merge 1 commit into
Open
fix(connect): handle null value sections in connector config validation#2485isliao613 wants to merge 1 commit into
isliao613 wants to merge 1 commit into
Conversation
Debezium Oracle 3.5.x returns null value sections for deprecated XStream properties (e.g. database.out.server.name). Three crash sites fixed across the connector UI: - createCustomProperties in state.ts: filter null-value entries before mapping, add errors ?? [] guard - validate() in state.ts: null guards on recommended_values and errors before isEqual comparisons - transitionConditionMet and getDataSource in create-connector.tsx: value?.errors ?? [] guard on errorCount sum and filter Also updates ConnectorProperty type to allow value: null, adds ConnectorPropertyWithValue predicate type, and adds unit tests covering all three null-value cases.
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
Debezium Oracle 3.5.x returns "value": null for deprecated XStream properties (e.g. database.out.server.name) in the Kafka Connect /connector-plugins/.../config/validate response. The Console UI crashed in three places when encountering these null value sections.
Crash 1 — createCustomProperties in state.ts:
TypeError: Cannot read properties of null (reading 'length')
at p.value.errors.length > 0
Fix: filter null-value entries with a type predicate before mapping; add errors ?? [] guard.
Crash 2 — validate() in state.ts:
TypeError: Cannot read properties of null (reading 'isEqual')
at suggestedSrc.isEqual(suggestedTar)
at target.errors.isEqual(source.errors)
Fix: ?? [] guards before .isEqual() calls.
Crash 3 — transitionConditionMet / getDataSource in create-connector.tsx:
TypeError: Cannot read properties of null (reading 'length')
at transitionConditionMet
Fix: value?.errors ?? [] guard on errorCount sum and getDataSource filter.
Type changes
Test plan