Skip to content

Bump kotlinx.collections.immutable to 0.5.0-beta01#6788

Open
DmitryNekrasov wants to merge 1 commit into
element-hq:developfrom
DmitryNekrasov:migrate-kotlinx-collections-immutable-0.5.0
Open

Bump kotlinx.collections.immutable to 0.5.0-beta01#6788
DmitryNekrasov wants to merge 1 commit into
element-hq:developfrom
DmitryNekrasov:migrate-kotlinx-collections-immutable-0.5.0

Conversation

@DmitryNekrasov
Copy link
Copy Markdown

Summary

Bumps kotlinx.collections.immutable from 0.4.0 to 0.5.0-beta01.

0.5.0-beta01 is binary-compatible with 0.4.0 — per KEEP-0459, the copy-returning methods on Persistent* types were renamed (e.g. addadding, removeremoving), and the old names remain as @Deprecated(WARNING) overloads. So this PR is purely a version bump and is reversible.

Why no source changes?

element-x-android uses kotlinx.collections.immutable as a read-only consumer — persistentListOf(...) etc. as factories, with values typed everywhere as ImmutableList<T> / ImmutableMap<K, V> / ImmutableSet<T> (the read-only interfaces). None of the renamed methods on Persistent* are visible at any call site, so the Kotlin compiler emits zero kotlinx.collections.immutable deprecation warnings after the bump.

Scope checks:

  • 463 .kt files import the library; 12 build files depend on it.
  • 0 declarations typed as Persistent(List|Map|Set|Collection)<…>.
  • 0 classes/objects/interfaces implementing the persistent interfaces.
  • 0 Java callers.
  • The single .mutate { } call (in IncomingVerificationStateMachine.kt) is a state-machine helper, not the kotlinx extension.

Changes

  • gradle/libs.versions.toml: kotlinx_collections_immutable = "…:0.4.0""…:0.5.0-beta01".
  • MIGRATION_REPORT.md: per-phase audit (happy to drop this if you'd prefer to keep the repo root tidy).

References

Test plan

  • Full compile: :app (Gplay + Fdroid debug, main + UnitTest) plus compileDebugUnitTestKotlin across all ~200 subprojects — BUILD SUCCESSFUL in 4m 58s (4939 tasks), zero kotlinx.collections.immutable deprecation warnings.
  • Unit tests: :libraries:recentemojis:impl:testDebugUnitTest, :libraries:usersearch:impl:testDebugUnitTest, :features:roomcall:impl:testDebugUnitTest — all pass.

🤖 Generated with Claude Code

Applied via kotlin-tooling-immutable-collections-0-5-0-migration skill.
0.5.0-beta01 is binary-compatible with 0.4.0; per KEEP-0459 the
copy-returning methods on Persistent* types are renamed (e.g.
add->adding, remove->removing) and the old names remain as
@deprecated(WARNING) overloads.

element-x-android uses the library as a read-only consumer
(persistentListOf -> ImmutableList<T> typed values, no in-place
mutation via Persistent* receivers), so the compiler emits zero
deprecation warnings post-bump and no call sites need to be renamed.

See MIGRATION_REPORT.md for per-phase details.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 14, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label May 14, 2026
@DmitryNekrasov DmitryNekrasov marked this pull request as ready for review May 14, 2026 12:34
@DmitryNekrasov DmitryNekrasov requested a review from a team as a code owner May 14, 2026 12:34
@DmitryNekrasov DmitryNekrasov requested review from ganfra and removed request for a team May 14, 2026 12:34
@DmitryNekrasov
Copy link
Copy Markdown
Author

Hi @ganfra — quick heads-up: this PR came out of testing a Claude Code skill I'm building for migrating Kotlin projects to kotlinx.collections.immutable 0.5.x (Kotlin/kotlin-agent-skills#45), so element-x-android was a real-world OSS testbed for a read-only consumer. No production urgency — happy to wait for the stable 0.5.0 release before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants