Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(services/dropbox): fix dropbox test failed #4317

Closed
wants to merge 2 commits into from
Closed

fix(services/dropbox): fix dropbox test failed #4317

wants to merge 2 commits into from

Conversation

zjregee
Copy link
Member

@zjregee zjregee commented Mar 5, 2024

fix: #4314

@zjregee zjregee requested a review from Xuanwo as a code owner March 5, 2024 04:41
@github-actions github-actions bot requested review from oowl and silver-ymz March 5, 2024 04:41
Copy link
Member

@oowl oowl left a comment

Choose a reason for hiding this comment

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

Thanks!

ErrorKind::Unexpected,
&format!("delete failed with error {}", error.error_summary),
);
let err = if let Some(error) = entry.error {
Copy link
Member

Choose a reason for hiding this comment

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

It's a bit odd that dropbox returns a failure without an error. Do you know the actual response from dropbox services?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry for overlooking a potential issue.

Yes, it returns an error format that the current DropboxErrorResponse cannot parse. We should modify DropboxErrorResponse to support the new error format.

Due to the 1password settings, I cannot completely reproduce the test in CI. The following are the results of testing using a personal account.

When an error occurs during the stat call, Dropbox returns an error like this:

{
    "error_summary": "path/not_found/",
    "error": {
        ".tag": "path",
        "path": {
            ".tag": "not_found"
        }
    }
}

When an error occurs during batch call, Dropbox returns an error like this (causing an expect error):

{
    ".tag": "complete",
    "entries": [
        {
            ".tag": "failure",
            "failure": {
                ".tag": "path_lookup",
                "path_lookup": {
                    ".tag": "not_found"
                }
            }
        }
    ]
}

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Seems we need to parse the error response from dropbox correctly.

@zjregee
Copy link
Member Author

zjregee commented Mar 6, 2024

I added DropboxDeleteBatchFailureResponse to parse errors during batch deletion.

When dropbox returns the following error.

{
    ".tag": "failure",
    "failure": {
        ".tag": "path_lookup",
        "path_lookup": {
            ".tag": "not_found",
        }
    }
}

OpenDAL will return such an error message.

Error: Unexpected (permanent) at delete, context: { service: dropbox, path:  } => delete failed with error path_lookup not_found

@Xuanwo
Copy link
Member

Xuanwo commented Mar 6, 2024

OpenDAL will return such an error message.

Thank you for looking into this. This is precisely the situation I wanted to address: we can ignore the "not_found" error when deleting.

@zjregee zjregee closed this by deleting the head repository Mar 6, 2024
@zjregee
Copy link
Member Author

zjregee commented Mar 6, 2024

I'm very sorry for deleting this PR due to my mistake. I will initiate a new PR later.

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

Successfully merging this pull request may close these issues.

ci: Dropbox failed for error should be present
3 participants