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

ffi: Return the state store directory name back after sanitizing

Open
#3,098 5 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

When the application creates a session, the SDK create asubfolder with a "sanitized" name:

https://github.com/matrix-org/matrix-rust-sdk/blob/916bf69e5c7630d63ffc6be9ceb1316efbec771f/bindings/matrix-sdk-ffi/src/client_builder.rs#L175

The application needs to know the folder name for instance to compute its size, or to fully delete it on session log out.

Currently the app is computing it using a simple replacement ":" -> "_", but that may not be enough for some userIds.

So the SDK should provide the created folder name, and a solution could be to add a new Client.getFolderName API.

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 bindings/matrix-sdk-ffi/src/client_builder.rs around the session directory creation at the linked line, and trace how the sanitized folder name is produced. The work is done when the FFI Client API returns the exact created folder name so applications can size or delete the session directory reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.