Skip to content

Conversation

lethemanh
Copy link
Contributor

No description provided.

@lethemanh lethemanh self-assigned this Aug 18, 2025
Copy link

bundlemon bot commented Aug 18, 2025

BundleMon

Unchanged files (3)
Status Path Size Limits
dist/cozy-ui.min.css
20.02KB -
transpiled/react/stylesheet.css
17.71KB -
dist/cozy-ui.utils.min.css
10.97KB -

No change in files bundle size

Groups updated (1)
Status Path Size Limits
transpiled/react/**
1009.33KB (+45B 0%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@@ -142,7 +142,7 @@ export class FileImageLoader extends Component {
throw new Error('No pdf files fallback')
}
const src = await client
.collection('io.cozy.files')
.collection('io.cozy.files', { driveId: file.driveId })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the file is an io.cozy.files object, where the driveId comes from ? It is not documented https://docs.cozy.io/cozy-doctypes/io.cozy.files.html 🤔 And I don't remember we have such attr on it.

Copy link
Member

@zatteo zatteo Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, did you test this to check if it works @lethemanh ? If I remember well, shared drive id comes from io.cozy.sharing and not io.cozy.files. Same for cozy/cozy-libs#2805 ?

About documentation, shared drives are still a work in progress on back side, so doctype documentation can be incomplete. But it will need to be completed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the request with driveId will send to this API sharings/drives/:driveId/downloads?Id=...&Filename=... and it's not working at this moment. This is the error

{
    "errors": [
        {
            "status": "422",
            "title": "Invalid Attribute",
            "detail": "Invalid document type",
            "source": {
                "pointer": "/data/attributes/type"
            }
        }
    ]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we have driveId on files https://github.com/cozy/cozy-stack/pull/4511/files & cozy/cozy-client#1604

So yeah doctype documentation needs to be updated once the stack PR is merged.

and yes sharings/drives/:driveId/downloads? seems to not have been implemented yet https://github.com/cozy/cozy-stack/pull/4511/files#diff-4ade94bc84a0d258576e850dcc6d9a18a5be2781ddb37103a3b2e910a550cf6fR322

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you are right. @taratatach is it possible implement this route also to download versions of a file ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This route has been implemented in cozy/cozy-stack@4e4c45e. Do you need something else?

@lethemanh lethemanh force-pushed the update-image-loader-for-shared-drive branch from bace81c to add44da Compare August 26, 2025 08:45
@lethemanh lethemanh force-pushed the update-image-loader-for-shared-drive branch from add44da to 6e46ebc Compare August 26, 2025 09:12
@rezk2ll rezk2ll merged commit cb4db8f into master Aug 26, 2025
12 checks passed
@rezk2ll rezk2ll deleted the update-image-loader-for-shared-drive branch August 26, 2025 09:21
@cozy-bot
Copy link

🎉 This PR is included in version 127.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JF-Cozy
Copy link
Collaborator

JF-Cozy commented Aug 27, 2025

be careful here I think we need an upgrade of cozy-client/cozy-stack-client because the API of import { downloadFile } from 'cozy-client/dist/models/file' changed, isn't it? 🤔 Besides we change the action of ActionsMenu/Actions/download and add a new option driveId. Is it working without it? If no, I'm afraid it's a breaking change...

@lethemanh
Copy link
Contributor Author

be careful here I think we need an upgrade of cozy-client/cozy-stack-client because the API of import { downloadFile } from 'cozy-client/dist/models/file' changed, isn't it? 🤔 Besides we change the action of ActionsMenu/Actions/download and add a new option driveId. Is it working without it? If no, I'm afraid it's a breaking change...

I've tested the download and get shared drive actions, both of them work as normal for 2 cases without driveId and with driveId

@rezk2ll
Copy link
Contributor

rezk2ll commented Aug 27, 2025

be careful here I think we need an upgrade of cozy-client/cozy-stack-client because the API of import { downloadFile } from 'cozy-client/dist/models/file' changed, isn't it? 🤔 Besides, we change the action of ActionsMenu/Actions/download and add a new option driveId. Is it working without it? If no, I'm afraid it's a breaking change...

You have a valid point; the dependencies should be updated accordingly next time.
This time, luckily, nothing was broken.

The cozy-client changes were merged here: cozy/cozy-client#1623
and the cozy-stack also here: cozy/cozy-stack@4e4c45e

And in this PR, we should've updated the cozy-client version to the one that included those merged changes.
So yes, what we did in this PR is messy and i'll make sure it won't happen again

@JF-Cozy
Copy link
Collaborator

JF-Cozy commented Aug 27, 2025

I've tested the download and get shared drive actions, both of them work as normal for 2 cases without driveId and with driveId

I think you tested it with the version of the app of cozy-client, not of the cozy-ui lib :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants