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

lib/model: Handle deleted-then-ignored files (fixes #3502) #3557

Closed
wants to merge 1 commit into from
Closed

lib/model: Handle deleted-then-ignored files (fixes #3502) #3557

wants to merge 1 commit into from

Conversation

calmh
Copy link
Member

@calmh calmh commented Sep 2, 2016

Purpose

When files that were previously marked as deleted became ignored, we used to do nothing at all. This changes that behavior to set the Invalid bit (that we should rename to Ignored). This then becomes an update to other devices that they should not trust our knowledge about the file in question.

Read this diff without whitespace...

Testing

Tested by

  • creating a bunch of files on s1
  • letting them sync to s2
  • shutting down s2
  • deleting the files on s1 and rescanning
  • adding the files to .stignore on s1 and rescanning
  • starting up s2 and letting it sync
  • observing the files are not deleted on s2, and it considers itself up
    to date.

When files that were previously marked as deleted became ignored, we
used to do nothing at all. This changes that behavior to set the Invalid
bit (that we should rename to Ignored). This then becomes an update to
other devices that they should not trust our knowledge about the file in
question.

Read this diff without whitespace...

Tested by
- creating a bunch of files on s1
- letting them sync to s2
- shutting down s2
- deleting the files on s1 and rescanning
- adding the files to .stignore on s1 and rescanning
- starting up s2 and letting it sync
- observing the files are not deleted on s2, and it considers itself up
  to date.
@AudriusButkevicius
Copy link
Member

AudriusButkevicius commented Sep 2, 2016

Did you repro the actual removal/bug tho?

@calmh
Copy link
Member Author

calmh commented Sep 2, 2016

Actually no, I just think that I understand it, so let me do that as well.

@calmh
Copy link
Member Author

calmh commented Sep 2, 2016

Yes. The exact same procedure described above results in the files gone from s2, without this patch.

@AudriusButkevicius
Copy link
Member

@st-review merge

@st-review
Copy link

👌 Merged as 46a143e. Thanks, @calmh!

@st-review st-review closed this Sep 2, 2016
st-review pushed a commit that referenced this pull request Sep 2, 2016
When files that were previously marked as deleted became ignored, we
used to do nothing at all. This changes that behavior to set the Invalid
bit (that we should rename to Ignored). This then becomes an update to
other devices that they should not trust our knowledge about the file in
question.

Read this diff without whitespace...

Tested by
- creating a bunch of files on s1
- letting them sync to s2
- shutting down s2
- deleting the files on s1 and rescanning
- adding the files to .stignore on s1 and rescanning
- starting up s2 and letting it sync
- observing the files are not deleted on s2, and it considers itself up
  to date.

GitHub-Pull-Request: #3557
@calmh calmh deleted the fix-3502 branch October 5, 2016 08:32
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Sep 2, 2017
@syncthing syncthing locked and limited conversation to collaborators Sep 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants