Skip to content

Commit

Permalink
Merge pull request #657 from nono/fix-mv-then-update
Browse files Browse the repository at this point in the history
Fix rename then update a file while offline
  • Loading branch information
nono authored Apr 24, 2017
2 parents 0572cb4 + 23cd61b commit 6af7441
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,17 @@ class Sync {
// $FlowFixMe
from = (this.moveFrom: Metadata)
this.moveFrom = null
if (from.moveTo === doc._id) {
if (from.moveTo === doc._id && from.md5sum === doc.md5sum) {
try {
await side.moveFileAsync(doc, from)
} catch (err) {
this.moveFrom = from
throw err
}
} else {
log.error('Invalid move')
log.error(from)
log.error(doc)
log.warn('Invalid move')
log.warn(from)
log.warn(doc)
try {
await side.addFileAsync(doc)
} catch (err) {
Expand Down

0 comments on commit 6af7441

Please sign in to comment.