Skip to content

Conversation

@nico-famedly
Copy link
Member

@nico-famedly nico-famedly commented Sep 19, 2025

Implements matrix-org/matrix-spec-proposals#3911 with some minor changes:

  • Support for linking avatars at room creation time
  • Accepts media ids with or without the mxc:// prefix

itsoyou and others added 30 commits August 19, 2025 14:27
jason-famedly and others added 22 commits October 23, 2025 06:14
Related: famedly/product-management#3448

Be more selective about what avatar url's are allowed to be set to the
profile of a given user. Particularly around remote media, but any media
that is suddenly "missing" could have this error.

Enhance the pre-flight validation to ensure that the media exists, with
selective conditions during the transition away from unrestricted media
to either ignore the error or forbid the operation.

Gracefully handle updating membership events during a profile avatar
change propagation. Most of the potential errors that can be raised here
should now be blocked by the pre-flight validation when setting the
profile. Additionally, outgoing remote invites and room creator join
membership events conditionally drop the avatar url if the media does
not exist and legacy unrestricted media is disabled
…ing github actions

Somehow, PyO3 version 0.24.1 is being used which only has support for
Python <= 3.13 even though the version pinned in Cargo.toml is 0.25.1.

It is unknown where exactly this version of PyO3 is coming from, but
caching oddities are suspected

Revert this after Synapse is overall bumped to Python 3.14 in v1.142.0
Lot of things going on here:
1. Enable the new `media_repo_instances` list for media workers
2. Add the new test package directory in Complement
3. Turn on `msc3911_enabled`
4. Make sure to route to workers when that mode is enabled

There is an additional temporary commit to be removed before merging. It
exists to override the branch name of Complement to pull for testing.
Once this is merged it should automatically allow the Synapse branch of
`msc3911` to target `msc3911` branch on the Complement repo. Other
branches/PRs should pull from the `main` branch, unless there exists a
branch of exactly the same name on both repos. E.g. if my PR has the
branch name `jason/cool-fixes` it will search for that exact same branch
name on Complement before falling back to `main`
# Linked Media MSC3911 AP?: Automatic media deletion
[#3365](famedly/product-management#3365)

Background job to automatically delete unattached media. This should
likely use the same 24h as asynchronous media uploads.

# Acceptance criteria

- [x] Background job to delete pending media after 24h
deletes

adjust some testing

moved this test case to a place that supports a thread pool, and broke
it into several testable components

remove unused stage_into_file() function

Apply feedback about resolve_path_to_media_file()

Lose this TODO and do not recreate the IOBytes object

Put back this new line, avoid merge conflicts

Abstract actual duplicate media deletion into it's own subroutine

Clean up counting how many references there are to a given media object
based on sha256

Update test to clarify some comments about behavior

Fix copypasta comment without update

lint
I guess because of a rust update?
… the test suite, and force some tests to always use isolated media paths
# Linked Media MSC3911 AP?: Deduplication- file path with sha256
[#3465](famedly/product-management#3465)
Fixes: #3465

Currently we are storing the file based on `media_id`. With msc3911
introduced, there are many copy actions and that creates duplicated
media. So now we try to save file with sha256 path and avoid
duplication.

There is a feature flag introduce with `use_sha256_paths`. But even with
feature flag is on, we still want to the existing media_id path logic
function well, and backward compatible. Feature flag also prevents the
existing tests failure.

Previously files were saved like this:
```
media/local_content/Ab/cD/...
media/local_thumbnails/Ab/cD/.../32-32-image-png-crop
media/remote_content/{server_name}/Ab/cD/...
```
But with `use_sha256_paths` enabled, media storage structure would be
like this:
```
media/eb/f4/...
thumbnails/eb/f4/.../32-32-image-png-crop
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants