-
Notifications
You must be signed in to change notification settings - Fork 27
Fix #372 - Do not create conflicted copies if the client has a newer version of a file, and upstream that file #443
Conversation
@@ -117,6 +118,9 @@ function createFS(options) { | |||
var autoSync; | |||
var pathCache; | |||
|
|||
// Path needed to be upstreamed during a downstream sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand this comment. I think it needs more context. It seems odd, on its face, to be talking about a path to be upstreamed during a downstream.
61d03fd
to
019b527
Compare
upstreamPath = resolvePath(needUpstream); | ||
requestSync(upstreamPath); | ||
} else { | ||
upstreamPath = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: it looks like needUpstream
and upstreamPath
are in play at the same time as one another; could we just use upstreamPath
to indicate that we need to upstream, and not have a second variable? If not possible, fine. Just wondering. The fewer variables and states to manage, the fewer bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/mozilla/makedrive/pull/443/files#diff-c3ede5b5250ec9a7181630da3090839aR211 uses it to manage error states...its kinda equivalent to pathCache in a way
I think code looks pretty reasonable, and I've done one pass through it. I think the proof is in the testing, though, so it would be good to see what @alicoding sees when running this patch with Mobile Webmaker. This was a pretty big change, thanks for getting it done so quickly. |
@alicoding would you be able to test this? |
File created before sync happen never get synced when connected again. STR:
|
Why do you expect to see the file if you haven't synced yet? How could the server have a file that is only local, and has never been synced? |
@humphd I actually did |
If you did |
@humphd Sorry, I meant after my second reconnect I was trying to see why my local file is not being sync and even I have tried |
@alicoding I might need more info because I tried to reproduce the error in the demo and am not getting it |
@humphd so @alicoding and I were discussing today about this issue that he found. It doesn't really seem directly related to my patch but it needs to be fixed (filed in #450). The thing is, triggering a sync relies on One way we thought about fixing this is by creating the More importantly, would you be able to quickly review my code again when you get time so that we can land this code before the milestone ends? |
pathCache = fs.pathToSync; | ||
fs.pathToSync = null; | ||
manager.syncPath(pathCache); | ||
// We do not expose a prototype that allows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this comment mean? That we need to do this in the future? If so, file a bug. If not, clarify the comment.
// If the file was modified before the | ||
// diffNode's modified time, the file is outdated | ||
// and needs to be patched | ||
if(stats.mtime <= diffNode.modified) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how we should deal with the NOMTIME
flag being set for the filesystem, see https://github.com/filerjs/filer#filerfilesystemoptions-callback-constructor. It would break your expectations here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can address it in #447
A few comments. Once those are fixed, make sure travis passes, and get @alicoding to do a functional test with Mobile Webmaker. I don't need to review this again unless it changes a lot. |
da60fba
to
0d3d864
Compare
@alicoding would you be able to test this on mobile webmaker? |
r+! |
… newer version of a file, instead upstream that file
0d3d864
to
f64388e
Compare
No description provided.