matrix-org / matrix-org/matrix-rust-sdk

Crashes on Element X Android: 'cannot fail because at least one empty chunk must exist'

Open
#6,153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

There are several crashes on Android with this error message when instantiating a timeline:

> items cannot fail because at least one empty chunk must exist

The code is here:

https://github.com/matrix-org/matrix-rust-sdk/blob/01bd672d05751c2ad88e4629ebeac124bb2be47b/crates/matrix-sdk-common/src/linked_chunk/mod.rs#L1030-L1035

The associated rageshakes I found are:
- https://github.com/element-hq/element-x-android-rageshakes/issues/9671
- https://github.com/element-hq/element-x-android-rageshakes/issues/9481
- https://github.com/element-hq/element-x-android-rageshakes/issues/9244

All of them happened after December of 2025, so it seems like a recent-ish change caused it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/matrix-sdk-common/src/linked_chunk/mod.rs around lines 1030-1035, then compare recent changes to the timeline and linked-chunk logic against the three associated rageshakes. Trace the state that causes timeline instantiation to reach the reported failure, reproduce it with an existing test or fixture if available, and verify that the crash is prevented with coverage for the failing state.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.