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

Potential orphaned resources left on sync target on resource conflict #5223

Closed
roman-r-m opened this issue Jul 21, 2021 · 1 comment
Closed
Labels
bug It's a bug desktop All desktop platforms high High priority issues

Comments

@roman-r-m
Copy link
Collaborator

It looks like whenever there's a resource conflict, Synchronizer will create a new copy of the conflicted resource and attach it to a new note:

static async createConflictResourceNote(resource: ResourceEntity) {
const Note = this.getClass('Note');
const conflictResource = await Resource.duplicateResource(resource.id);
await Note.save({
title: _('Attachment conflict: "%s"', resource.title),
body: _('There was a [conflict](%s) on the attachment below.\n\n%s', 'https://joplinapp.org/conflict/', Resource.markdownTag(conflictResource)),
is_conflict: 1,
}, { changeSource: ItemChange.SOURCE_SYNC });
}

The note is marked as conflict and so will be skipped during sync but it looks like the duplicated resource will still be uploaded to the sync target.

@roman-r-m roman-r-m changed the title Potential orphaned resources on resource conflict Potential orphaned resources left on sync target on resource conflict Jul 22, 2021
@laurent22
Copy link
Owner

Indeed I think the implementation is not quite right. It's also not logical to create a conflict note when it's the resource that's actually in conflict. Maybe the note should simply be added to a regular notebook, so that there's no special rules applying to it.

@laurent22 laurent22 added desktop All desktop platforms high High priority issues bug It's a bug labels Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues
Projects
None yet
Development

No branches or pull requests

2 participants