Skip to content

Discovery: Add branding option to disable default sync of 'M' directo… - #5340

Merged
guruz merged 8 commits into
masterfrom
issue_5331
Jan 27, 2017
Merged

guruz merged 8 commits into
masterfrom
issue_5331

Conversation

@ogoffart

Copy link
Copy Markdown
Contributor

@mention-bot

Copy link
Copy Markdown

@ogoffart, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dragotin, @guruz and @cryptomilk to be potential reviewers.

@ogoffart

Copy link
Copy Markdown
Contributor Author

(untested)

@guruz guruz added this to the 2.3.0 milestone Nov 29, 2016
@rperezb

rperezb commented Nov 29, 2016

Copy link
Copy Markdown

@SamuAlfageme calling you! 📲

@guruz

guruz commented Nov 29, 2016

Copy link
Copy Markdown
Contributor

👎 doesn't work, debugging

guruz added a commit that referenced this pull request Nov 29, 2016
@guruz guruz added the ReadyToTest QA, please validate the fix/enhancement label Nov 29, 2016
@guruz

guruz commented Dec 2, 2016

Copy link
Copy Markdown
Contributor

@SamuAlfageme You can test this by having an external storage configured in your oC server (files_external). I tried with a system wide mount but you could try with a user mount.
It should then show up unsynced by default in selective sync

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@ogoffart @guruz let me get this straight: bool dontSyncMountedStorageByDefault() const { return true; } should not mount external storage by default? Cause if that's the case, trying with 3 different external storage opts. configured (Dropbox, Drive & Local), all of them are selected in the selective sync view by default.

@SamuAlfageme

SamuAlfageme commented Dec 12, 2016 •

Copy link
Copy Markdown
Contributor

So far what I found:

  • Both account setup wizard options (sync everything and choose what to sync) are still selecting by default all the folders, including the ones from external storage.
  • When deleting .csync_journal.db, 3 actions are displayed and the folders unchecked, however none of those are erasing the contents from the local sync folder (plus the message shown is addressing size problems, instead of external-storage reasons):

jorl

@SamuAlfageme SamuAlfageme removed the ReadyToTest QA, please validate the fix/enhancement label Dec 13, 2016
@michaelstingl

Copy link
Copy Markdown
Contributor

@SamuAlfageme What is the exact test procedure?

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@michaelstingl you need to modify the theme to set dontSyncMountedStorageByDefault() const { return true; } and build with the issue_5331 branch.

From there, I can provide you with a test server with 2/3 different external storage options configured and running. And you can see how the auto-deselect doesn't work neither on the create account wizard nor when deleting (to force restore) the .csync_journal.db on the root folder sync connection.

Second scenario unchecks the external storage folders but does not remove them from the local filesystem when selecting any of those 3 options.

@ckamm

ckamm commented Jan 4, 2017

Copy link
Copy Markdown
Contributor

One of @SamuAlfageme's issues is that the initial folder setup doesn't check for 'M' directories. In a way this is similar to what I addressed in #5426. It'd be nice to share the "dubious folder" logic between discovery and initial setup so we don't have to worry about it in the future.

@SamuAlfageme

SamuAlfageme commented Jan 10, 2017 •

Copy link
Copy Markdown
Contributor

🔝 Cherrypicking the changes in #5426 for testing purposes...

@ckamm

ckamm commented Jan 11, 2017

Copy link
Copy Markdown
Contributor

@SamuAlfageme @ogoffart I've addressed the inconsistency between setup and later synchronization in ckamm@39d048a - shall I include that patch here?

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@ckamm sure! will re-test as soon as it's ready.

@ckamm

ckamm commented Jan 11, 2017

Copy link
Copy Markdown
Contributor

@SamuAlfageme I've put it into this PR for now, but it's pending @ogoffart's opinion.

@ogoffart

Copy link
Copy Markdown
Contributor Author

I added some fixup commit.

The remaining issues i could think of with this patch:

  • The rewording, as i wrote on IRC: the reason it was phrased like (with double negative) that is because it is a black list. So it is "unselected item will not be synced" rather than "selected items will be synced". The difference is weak, but it is to make sure people don't complain that they select "foo/bar", but not "foo", and yet, the file within foo are sync'ed.
    I don't have a strong opinion. And if you think the new wording is easier to understand, let's just change it.

  • The 'M' detection will only work for top level directories. We don't check for sub directories. I guess that's fine because mount point are always top level, are they not?

@SamuAlfageme

SamuAlfageme commented Jan 11, 2017 •

Copy link
Copy Markdown
Contributor

New tests after these changes are looking good so far: 🎉

screenshot 2017-01-11 18 36 23

There's also this one conceptual thing we need to address: #5421 (comment) because Sync everything + do not sync ext.sto. will result in syncing ext.sto.

cc/ @michaelstingl

@SamuAlfageme

Copy link
Copy Markdown
Contributor

After including the message pointing the cause of folders being unchecked there should be the same for newly created storages. cc/ @ckamm

new_ext_sto

Answering to @ogoffart's #5340 (comment)

The 'M' detection will only work for top level directories. We don't check for sub directories. I guess that's fine because mount point are always top level, are they not?

Well, looks like yes, if you specify a path for the mounting point instead of a single, folder name; it's mounted that path (if available; I'm investigating a bug related with this). I don't know if this is the expected behavior though. cc/ @PVince81

screenshot 2017-01-12 10 06 13

Also, again, we have discrepancies between what happens on the wizards and if changes were made in an already created folder sync connection. In the second scenario, folder is unchecked:

subfolder_mounting_point

In the first, as addressed in 7344571 it isn't. So we should have an uniform way of dealing with this.


@ogoffart agreed on having a different name for the option as current (double negation antipattern) is too confusing (and was source of my question on #5340 (comment))

@ogoffart

Copy link
Copy Markdown
Contributor Author

@michaelstingl Should the branding option be only for new folder, or also for new sync?

i.e, in the first sync, if the user selected "Sync Everything" in the wizard, should the 'M' folder be sync'ed or not?

@ckamm

ckamm commented Jan 20, 2017

Copy link
Copy Markdown
Contributor

@ogoffart How about we merge this to have it in 2.3 and create a new ticket to discuss the implications on the wizards? If merging this soon isn't urgent, we can also keep it like this.

@ogoffart

Copy link
Copy Markdown
Contributor Author

@SamuAlfageme Thanks for testing! I have fixed most issues. I icreased the default size of the wizard so everything fits.

The checkboxes do not affect the contents of the Choose what to sync... filepicker

That is expected i'd say. (See comment #5340 (comment) )

Group [notifications] in one instead of displaying them in batch after clicking in Connect...

The API for notifications is "fire and forget". So we'd need to accumulate them and only show the notification when discovery is finished. We can do that. But that's a bigger change which i might do later.

some of the folder names are cropped after the line break.

I could not reproduce that. Maybe it's only on Mac?

@SamuAlfageme

SamuAlfageme commented Jan 26, 2017 •

Copy link
Copy Markdown
Contributor

@ogoffart awesome, updated #5340 (comment) and will move some of the things that can be improved to individual issues to address them later so we can merge here. Couple of simple things before so,

  • The wizard window now looks huge:

screenshot 2017-01-26 11 36 29

  • The new icons introduced in ed15842 are not being used in the "Choose what to sync" view:

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@ogoffart and finally, extracted from #5340 (comment):

[If checkboxes apply to 'Choose what to sync' as well they should probably be placed below, not in between the both options]

  • Place the the confirmation options below the Sync everything/Choose what to sync radio buttons

@ogoffart

Copy link
Copy Markdown
Contributor Author

@SamuAlfageme : Do you think the wizard is now too big?

Regarding the choose what to sync, i'll change their icon in a follow up pull request.
But the checkboxes do not apply to the choose what to sync.

Comment thread src/libsync/discoveryphase.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saying in future it would be nice if all variables with time or bytes are called something like ...msec or ..bytes etc. Not important now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have such functions named "is..." or "are..." to see it is a getter

Comment thread src/libsync/theme.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @rperezb

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guruz thanks!

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@ogoffart

Do you think the wizard is now too big?

Kind of, yeah 😕. Took the whole screen on my Win7 VM, it's bigger than the application main window and there's a lot of unused space on the right.

Regarding the choose what to sync, i'll change their icon in a follow up pull request.

Great! 😉

But the checkboxes do not apply to the choose what to sync.

They do if they're set as global settings, so I would rather enable them for both options and place them under the radio buttons.

@guruz

guruz commented Jan 26, 2017

Copy link
Copy Markdown
Contributor

Code looks OK 👍
I have not tested the actual functionality.

wizard is also too big on my screen, please reduce and merge.

@SamuAlfageme Did you also test this with deeper directory structures? Will creating a new directory on the server side deep inside the mounted storage again ask for confirmation?

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@guruz

Did you also test this with deeper directory structures?

Yeah, looks good so far:

screenshot 2017-01-26 17 56 33

Will creating a new directory on the server side deep inside the mounted storage again ask for confirmation?

Tried making superficial changes on the external storage and it was ok, program logic could point otherwise?

The advanced page has become quite complex and does not fit on the screen
anymore if the fonts are too big
We need to forward the information that the folder is an external storage
for the notification message.

Issue: #5340 (comment)
… added

The Size limit, or confirmation checkboxes might have changed.

We need to guard against saving if the control changes while we are loading

Issue: #5340 (comment)
@ogoffart

Copy link
Copy Markdown
Contributor Author

I resized the wizard again (750 pixels wide)

@guruz
guruz merged commit 65e4afe into master Jan 27, 2017
guruz pushed a commit that referenced this pull request Jan 27, 2017
Added two checkboxes in the Account Wizard in the advanced page to change the first options.
Also added a checkbox in the general settings to ask for confirmation for external storages.

Theme options allow to hide the checkboxes in the wizard.

As described in issue #5340
guruz pushed a commit that referenced this pull request Jan 27, 2017
The sync engine rely on the 'M' in premission to ask for confirmation
(As requested in issue #5340)
But we only want to ask the premission for the 'root' of the mounting point and not
for every subfolders within it.
So we change the discovery phase in a way that it does not keep the 'M' for
children within the external storage.
guruz pushed a commit that referenced this pull request Jan 27, 2017
We need to forward the information that the folder is an external storage
for the notification message.

Issue: #5340 (comment)
guruz pushed a commit that referenced this pull request Jan 27, 2017
… added

The Size limit, or confirmation checkboxes might have changed.

We need to guard against saving if the control changes while we are loading

Issue: #5340 (comment)
@guruz
guruz deleted the issue_5331 branch January 27, 2017 15:00
@guruz
guruz restored the issue_5331 branch January 27, 2017 15:00
@guruz

guruz commented Jan 27, 2017

Copy link
Copy Markdown
Contributor

@ogoffart I accidently merged this to master instead of 2.3.
Do you want to merge to 2.3 manually with git?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blue-ticket Enhancement p2-high Escalation, on top of current planning, release blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants