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

feat: Acknowledge noSanitize in all file methods #310

Conversation

taratatach
Copy link
Member

By default document names are sanitized (i.e. trimmed) when making
requests to the Cozy.
However, some clients like Cozy Desktop require that the names they
pass to cozy-client-js are passed on untouched to the Cozy (in case
of Cozy Desktop, doing otherwise will lead to a de-synchronized state
between the local and remote trees).

We already have a noSanitize option that prevents the sanitation
from happening but it's only available when creating files via the
create method.
We now add and use this option in all methods that would otherwise
sanitize the document name by default.

  By default document names are sanitized (i.e. trimmed) when making
  requests to the Cozy.
  However, some clients like Cozy Desktop require that the names they
  pass to `cozy-client-js` are passed on untouched to the Cozy (in case
  of Cozy Desktop, doing otherwise will lead to a de-synchronized state
  between the local and remote trees).

  We already have a `noSanitize` option that prevents the sanitation
  from happening but it's only available when creating files via the
  `create` method.
  We now add and use this option in all methods that would otherwise
  sanitize the document name by default.
@taratatach taratatach self-assigned this Feb 11, 2021
Copy link

@LucsT LucsT left a comment

Choose a reason for hiding this comment

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

Ok pour moi.
Ne devrait pas changer le comportement par défault.

@taratatach taratatach merged commit 8b7e96f into master Feb 12, 2021
@taratatach taratatach deleted the feat/add-noSanitize-option-to-all-methods-sanitizing-doc-names branch February 12, 2021 17:00
@Crash--
Copy link
Contributor

Crash-- commented Feb 15, 2021

We should have added at least one test in https://github.com/cozy/cozy-client-js/blob/master/test/unit/files.js

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

Successfully merging this pull request may close these issues.

4 participants