matrix-org / matrix-org/matrix-rust-sdk
Rearrange SentMediaInfo and AccumulatedSentMediaInfo
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
In https://github.com/matrix-org/matrix-rust-sdk/pull/4897, a new field `accumulated: Vec` was introduced into `SentMediaInfo`. This was convenient because it didn't require a data migration but lead to an odd duplication where `SentMediaInfo` contains the fields for an item that will later move into `accumulated`. Instead, we should rearrange the structs so that:
- `SentMediaInfo` contains only the vec of `AccumulatedSentMediaInfo` (since a vec can hold the pair for the media, when there's only a single one and no gallery)
- `AccumulatedSentMediaInfo` (maybe rename `SingleSentMediaInfo`?) can keep on holding its current fields
This will then require a data migration which is why it was broken out from https://github.com/matrix-org/matrix-rust-sdk/pull/4897.
See also https://github.com/matrix-org/matrix-rust-sdk/pull/4897/files#r2048581359.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PR 4897 and the referenced review discussion, then locate the SentMediaInfo and AccumulatedSentMediaInfo definitions and their usages. The work is complete when SentMediaInfo contains only the accumulated vector, the related data migration is handled, and affected code continues to compile and pass its existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100