Fix S3 folder creation for new AWS API#11726
Conversation
This also fixes the unit tests
|
Please review @LukasReschke @butonic @helmutschneider @icewind1991 |
|
Basically the new API requires all objects to have a body... in our case we abuse the object store by creating dummy entries for folders. There folders now need to have a (empty) body as well. |
|
I tested creating a folder over the UI and it also worked fine. |
|
Not sure, maybe some other change sneaked in and broke it somehow. |
|
The inspection completed: No new issues |
|
Just tried 993376f (before this PR) and it's not possible to create folders in the UI. There's an exception "You must specify a non-null value for the Body or SourceFile parameters." |
|
@helmutschneider your code from d2979da seems correct. It seems your change possibly got lost in a merge conflict resolution 😕 |
|
@PVince81 No, that code is only relevant to the touch action (which I noticed was failing). My local tests did not fail on mkdir though which is really weird. Also unlikely that amazon changed their S3 api :/ |
|
@helmutschneider I found the reason: https://github.com/owncloud/core/pull/11375/files#r19245328 There was that other PR to stable7 to fix stuff. When I ported it to master I didn't know I needed to put the "Body" back. |
|
@helmutschneider it seems the file already had the correct code when you made your change: https://github.com/helmutschneider/core/blob/d2979da864bd7b9759a0efb60e6eed62d79fe473/apps/files_external/lib/amazons3.php#L151 The "Body" part likely got lost when I forward ported #11375 |
|
Anyway, if the change makes sense (and runs for you) I'd appreciate a thumbs up for the review 😄 |
|
@PVince81 I don't have time to test right now but I trust your judgement. Code makes sense too. Well done! 👍 |
|
🚀 Test PASSed. 🚀 |
|
Thanks! |
|
👍 |
Fix S3 folder creation for new AWS API
This also fixes the unit tests
Fixes #11725
S3 unit tests now all pass for me locally.