Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: konnectors/libs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: konnectors/libs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: wip-Retelechargement
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jan 18, 2024

  1. wip

    LucsT committed Jan 18, 2024
    Copy the full SHA
    ab9748f View commit details
Showing with 6 additions and 1 deletion.
  1. +6 −1 packages/cozy-konnector-libs/src/libs/saveFiles.js
7 changes: 6 additions & 1 deletion packages/cozy-konnector-libs/src/libs/saveFiles.js
Original file line number Diff line number Diff line change
@@ -202,6 +202,7 @@ const saveEntry = async function (entry, options) {
if (file) {
try {
shouldReplace = await shouldReplaceFile(file, entry, options)
log('warn', `shouldReplace at toplevel ${shouldReplace}`)
} catch (err) {
log('info', `Error in shouldReplaceFile : ${err.message}`)
shouldReplace = true
@@ -505,7 +506,11 @@ const shouldReplaceFile = async function (file, entry, options) {
const result =
getAttribute(file, `metadata.${attr}`) !==
get(entry, `fileAttributes.metadata.${attr}`)

if (result) log('debug', `filereplacement: adding ${attr} metadata`)
log('warn', `For ${attr} Result is ${result}`)
log('warn', 'file' + JSON.stringify(getAttribute(file, `metadata.${attr}`)))
log('warn', 'entry' + JSON.stringify(get(entry, `fileAttributes.metadata.${attr}`)))
return result
}
// replace all files with meta if there is file metadata to add
@@ -536,7 +541,7 @@ const shouldReplaceFile = async function (file, entry, options) {
if (hasSourceAccountIdentifierOption && !fileHasSourceAccountIdentifier)
log('debug', 'filereplacement: adding sourceAccountIdentifier')
}

log('warn', `Result in shouldReplace ${result}`)
return result
}
const shouldReplaceFileFn =