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

Rearrange SentMediaInfo and AccumulatedSentMediaInfo

Open
#4,969 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Send queue enhancement
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.