matrix-spec-proposals icon indicating copy to clipboard operation
matrix-spec-proposals copied to clipboard

MSC2246: Asynchronous media uploads

Open tulir opened this issue 6 years ago • 8 comments

Rendered

Implementations:

  • Server: https://github.com/turt2live/matrix-media-repo/pull/364, https://github.com/matrix-org/synapse/pull/12484
  • Client upload (actually a bridge): https://github.com/mautrix/go/commit/3b9911029134eb2d5de96f7898a70064199061a5 + https://github.com/mautrix/whatsapp/commit/f79ca422e8c3df7801f3e5e6a896ccf725eb1f14
  • Client download should work with all existing clients to some extent with the 20s default stalling

Signed-off-by: Tulir Asokan [email protected]


FCP Proposal

tulir avatar Aug 24 '19 13:08 tulir

sounds excellent to me; would love to unblock streaming transfers at last. need to consider risk of DoS by creating lots of IDs, and define the json if any handed to the /create (for instance, could be useful in future for defining whether a give mxc url should be locked behind auth of some kind)

ara4n avatar Aug 24 '19 14:08 ara4n

The idea is then to send a media event, after the new /create endpoint, and before sending the media itself; isn't it? We have to consider the failure of the upload: it can lead to media event with eternal not found media. Also the client should have a way to know that the media is not yet available to the server for a better UI, by displaying a waiting message (ex: Bob is sending an image) for instance?

bmarty avatar Aug 27 '19 17:08 bmarty

bump?

JuniorJPDJ avatar May 22 '21 23:05 JuniorJPDJ

The author believes this MSC has all the required implementation detail and is ready for FCP.

turt2live avatar Mar 21 '22 19:03 turt2live

looks great to me.

@mscbot fcp merge

richvdh avatar Mar 22 '22 16:03 richvdh

Team member @mscbot has proposed to merge this. The next step is review by the rest of the tagged people:

  • [ ] @dbkr
  • [x] @uhoreg
  • [x] @turt2live
  • [x] @ara4n
  • [x] @anoadragon453
  • [x] @richvdh
  • [x] @erikjohnston
  • [ ] @KitsuneRal

Concerns:

  • ~~Different spam reduction controls appear to be required (read: taking a while to upload is a feature)~~
  • ~~Edge case error codes need to be specified~~
  • ~~Empty security considerations on a user-generated content endpoint~~
  • ~~The client shouldn't be allowed to stall the server for infinite milliseconds (the server should impose a limit)~~

Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for information about what commands tagged team members can give me.

mscbot avatar Mar 22 '22 16:03 mscbot

FWIW, https://github.com/matrix-org/synapse/pull/12484 is a working implementation of this MSC in Synapse.

sumnerevans avatar May 30 '22 15:05 sumnerevans

@mscbot concern Different spam reduction controls appear to be required (read: taking a while to upload is a feature) @mscbot concern Edge case error codes need to be specified @mscbot concern Empty security considerations on a user-generated content endpoint @mscbot concern The client shouldn't be allowed to stall the server for infinite milliseconds (the server should impose a limit)

turt2live avatar Jun 01 '22 03:06 turt2live

@mscbot resolve Different spam reduction controls appear to be required (read: taking a while to upload is a feature) @mscbot resolve Edge case error codes need to be specified @mscbot resolve Empty security considerations on a user-generated content endpoint @mscbot resolve The client shouldn't be allowed to stall the server for infinite milliseconds (the server should impose a limit)

turt2live avatar Apr 19 '23 21:04 turt2live

:bell: This is now entering its final comment period, as per the review above. :bell:

mscbot avatar Apr 19 '23 21:04 mscbot

The final comment period, with a disposition to merge, as per the review above, is now complete.

mscbot avatar Apr 24 '23 21:04 mscbot

Spec PR: https://github.com/matrix-org/matrix-spec/pull/1499

richvdh avatar Apr 25 '23 14:04 richvdh

Merged 🎉

turt2live avatar May 03 '23 15:05 turt2live

I know I'm very late, but it's surprising that nobody mentioned tus yet, which allows for resumable file uploads. Since the core is headers + PATCH it can luckily be retrofitted into matrix in a future msc, if anyone wants it.

tezlm avatar Oct 17 '23 03:10 tezlm

For future code sleuths:

Async uploads PR: https://github.com/matrix-org/synapse/pull/15503

Released in Synapse:

  • https://github.com/matrix-org/synapse/releases/tag/v1.97.0rc1

sumnerevans avatar Nov 21 '23 17:11 sumnerevans