Skip to content

Fix nullability mismatch in deprecated newConfig extension#122

Merged
borrrden merged 1 commit into
release/3.4from
fix/config_factory_nullability
Jun 11, 2026
Merged

Fix nullability mismatch in deprecated newConfig extension#122
borrrden merged 1 commit into
release/3.4from
fix/config_factory_nullability

Conversation

@borrrden

Copy link
Copy Markdown
Member

Problem

./gradlew ciBuild fails to compile with:

e: ConfigurationFactories.kt:103:61 Type mismatch: inferred type is ReplicatorConfiguration? but BaseReplicatorConfiguration was expected

getCollectionConfigs() was tightened to take a non-null BaseReplicatorConfiguration (CBL-7303), but the re-added 3.x deprecated ReplicatorConfiguration?.newConfig extension still passes its nullable receiver this, breaking compilation.

Fix

Guard the call with this?.let { getCollectionConfigs(it) }.

This matches the 3.3 behavior exactly: the ReplicatorConfiguration(Endpoint, Map?) constructor treats a null collection map as empty (new HashMap<>()), so a null receiver yields an empty configuration just as getCollectionConfigs(null) returned null in 3.3.

🤖 Generated with Claude Code

getCollectionConfigs() was tightened to take a non-null
BaseReplicatorConfiguration (CBL-7303), but the re-added 3.x
deprecated ReplicatorConfiguration?.newConfig extension still
passes its nullable receiver, breaking compilation.

Guard the call with this?.let { getCollectionConfigs(it) }. This
matches the 3.3 behavior: the ReplicatorConfiguration constructor
treats a null collection map as empty, so a null receiver yields
an empty configuration exactly as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

This is a release branch and commits are restricted.

Please confirm this PR is one of the following:

  • A response to a customer ask
  • A change per our security policy
  • A non-functional change (i.e. changes needed for building an older version)
  • A change that has been granted an exception (please comment)

@borrrden

Copy link
Copy Markdown
Member Author

Regression within the branch

@borrrden borrrden requested a review from pasin June 11, 2026 01:05
@borrrden borrrden merged commit 5fc3c7f into release/3.4 Jun 11, 2026
1 check passed
@borrrden borrrden deleted the fix/config_factory_nullability branch June 11, 2026 01:54
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.

2 participants