We made a change to fast load images as huge repos with a lot of images had very slow load times.
We used to do: get all files -> calculate hash -> filter/paginate
Now, we get all files -> filter/paginate -> calculate hash
For the get all files to be fast, we removed the sha calculation in the first step of get all files. However, this affected other ops which use list directory contents
Specifically, when we try to rename a subfolder, we need to delete the current directory and re-create a new one
When deleting the current directory, it uses list directory method, but the sha is not present. So when it does a verification of oldSha === newSha, it fails as oldSha is undefined. This causes BE to think that the file was recently changed, so it blocks the delete operation.
Hence, the rename op fails, and we do a rollback. We return 409 saying someone edited the file.
tests
Ensure ci/test passes
On staging, test renaming sub-folders on email login
Sites with > 15 images should be paginated and switching across pages should be smooth
fix for renaming subfolders
context
We made a change to fast load images as huge repos with a lot of images had very slow load times.
We used to do: get all files -> calculate hash -> filter/paginate Now, we get all files -> filter/paginate -> calculate hash
For the get all files to be fast, we removed the sha calculation in the first step of get all files. However, this affected other ops which use list directory contents
Specifically, when we try to rename a subfolder, we need to delete the current directory and re-create a new one When deleting the current directory, it uses list directory method, but the sha is not present. So when it does a verification of oldSha === newSha, it fails as oldSha is undefined. This causes BE to think that the file was recently changed, so it blocks the delete operation.
Hence, the rename op fails, and we do a rollback. We return 409 saying someone edited the file.
tests