mautrix / python

A Python 3 asyncio Matrix framework.
Mozilla Public License 2.0
183 stars 74 forks source link

Media Repos with unlimited upload/download size #133

Closed benedikt-bartscher closed 1 year ago

benedikt-bartscher commented 1 year ago

Mautrix fails with Media Repos with this config:

uploads:
    maxBytes: 0
download:
    maxBytes: 0

which according to the docs should disable the upload/download limit (https://docs.t2bot.io/matrix-media-repo/uploads/index.html)

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mautrix/types/util/serializable_attrs.py", line 212, in _dict_to_attrs
    obj = attrs_type(**new_items)
TypeError: MediaRepoConfig.__init__() missing 1 required positional argument: 'upload_size'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mautrix/client/api/modules/media_repository.py", line 280, in get_media_repo_config
    return MediaRepoConfig.deserialize(content)
  File "/usr/lib/python3.10/site-packages/mautrix/types/util/serializable_attrs.py", line 375, in deserialize
    return _dict_to_attrs(cls, data)
  File "/usr/lib/python3.10/site-packages/mautrix/types/util/serializable_attrs.py", line 218, in _dict_to_attrs
    raise SerializerError(
mautrix.types.util.serializable.SerializerError: Missing value for required key m.upload.size in MediaRepoConfig

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mautrix/bridge/matrix.py", line 250, in wait_for_connection
    self.media_config = await self.az.intent.get_media_repo_config()
  File "/usr/lib/python3.10/site-packages/mautrix/client/api/modules/media_repository.py", line 282, in get_media_repo_config
    raise MatrixResponseError("Invalid MediaRepoConfig in response") from e
mautrix.errors.base.MatrixResponseError: Invalid MediaRepoConfig in response