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

Conflict file names should include user name if uploaded #6325

Closed
ckamm opened this issue Jan 22, 2018 · 13 comments
Closed

Conflict file names should include user name if uploaded #6325

ckamm opened this issue Jan 22, 2018 · 13 comments
Assignees
Labels
ReadyToTest QA, please validate the fix/enhancement
Milestone

Comments

@ckamm
Copy link
Contributor

ckamm commented Jan 22, 2018

In master the client can optionally upload conflict files. In this case it's easy for there to be several conflict files uploaded to the server by different users. In this situation it is very useful if it's immediately obvious which user created which conflict file. This should become part of the conflict file name:

foo-conflict_20180115-1412.txt
foo-conflict_20180112-1100.txt
vs
foo-conflict_frank_20180115-1412.txt
foo-conflict_greta_20180112-1100.txt
@ckamm ckamm added the Feature label Jan 22, 2018
@ckamm ckamm added this to the 2.5.0 milestone Jan 22, 2018
@ckamm ckamm self-assigned this Jan 22, 2018
@ckamm
Copy link
Contributor Author

ckamm commented Jan 23, 2018

@PVince81 @DeepDiver1975 I'm planning to use the dav username, that is the string used in /remote.php/dav/files/<user>/ inside generated conflict files. Would there be a better choice?

@SamuAlfageme
Copy link
Contributor

@ckamm I think that'd result in a UUID on LDAP setups (for the same reason we still have troubles with things like owncloud/oauth2#109 (comment)) 😕

@ckamm
Copy link
Contributor Author

ckamm commented Jan 23, 2018

@SamuAlfageme Great catch, so we need to determine the "display user" first! Do you know if using the "display-name" from ocs/v1.php/cloud/user would be correct? Or rather "id" because we want something suitable for a filename?

EDIT: Nevermind, davUser is exactly that value. Hmm.

@SamuAlfageme
Copy link
Contributor

@ckamm since it's gonna be used for a filename (whitespace-safe) you can get the current logged in display name from the User Provisioning API i.e./ocs/v1.php/cloud/user

@ckamm
Copy link
Contributor Author

ckamm commented Jan 23, 2018

@SamuAlfageme I had edited my comment a bit. The display name can be long and have spaces - though that's not necessarily a problem. It could have characters that aren't valid in filenames.

@hodyroff
Copy link

hodyroff commented Feb 2, 2018

Hm, really? This lands in the versions, right? The versions view should have the ability to list the user ... not sure changing the filename is a great idea ... think about long file names which will go out of bound quickly ...

@ckamm
Copy link
Contributor Author

ckamm commented Feb 2, 2018

@hodyroff No, as yet this does not interact with the server's versions functionality. See https://github.com/owncloud/platform/issues/159 for a detailed description of the conflict-uploading feature.

@PVince81
Copy link
Contributor

PVince81 commented Feb 2, 2018

The versions view should have the ability to list the user

The server doesn't store the user id of who modified a file. Would require a new column in oc_filecache or better: move the versions out of oc_filecache into a separate table where we can store more information. See owncloud/core#2263

@guruz
Copy link
Contributor

guruz commented Feb 6, 2018

Great catch, so we need to determine the "display user" first!

FYI we do this already for the toolbar.

void ConnectionValidator::fetchUser()

It could have characters that aren't valid in filenames.

mhm.

@ckamm
Copy link
Contributor Author

ckamm commented Feb 9, 2018

So, what do we actually do? The user id can be a uuid, and the display name can be verbose and unsuitable for filenames. Names can have all shapes and forms, so extracting something from the display name is prone to break in odd ways. The local host name wouldn't look good.

I'd start out with a sanitized display name.

ckamm added a commit that referenced this issue Feb 19, 2018
For the case of uploading conflict files only.
ckamm added a commit that referenced this issue Feb 19, 2018
For the case of uploading conflict files only.
ckamm added a commit that referenced this issue Feb 19, 2018
For the case of uploading conflict files only.
ckamm added a commit that referenced this issue Feb 19, 2018
For the case of uploading conflict files only.
ckamm added a commit that referenced this issue Feb 20, 2018
For the case of uploading conflict files only.
ckamm added a commit that referenced this issue Feb 20, 2018
For the case of uploading conflict files only.
@ckamm ckamm added the ReadyToTest QA, please validate the fix/enhancement label Feb 20, 2018
@SamuAlfageme
Copy link
Contributor

Done and documented on https://doc.owncloud.org/desktop/2.5/conflicts.html - great job 👍

@jnweiger
Copy link
Contributor

jnweiger commented Aug 8, 2018

linux mint tara

testpilotcloud version 2.5.0daily20180808 (build 10016)

OK
works nicely when enabled.

BAD
The username should always be there, not only when enabled.
See example #4557 (comment)

BAD
The feature should be enabled per default :-)

@guruz
Copy link
Contributor

guruz commented Aug 10, 2018

The username should always be there, not only when enabled.

agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ReadyToTest QA, please validate the fix/enhancement
Projects
None yet
Development

No branches or pull requests

6 participants