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

Ensure files with invalid characters in the name are handled. #26

Open
pcstout opened this issue May 9, 2019 · 7 comments
Open

Ensure files with invalid characters in the name are handled. #26

pcstout opened this issue May 9, 2019 · 7 comments
Assignees

Comments

@pcstout
Copy link
Member

pcstout commented May 9, 2019

Synapse has restrictions on which characters can be in a file/folder name.
Make sure the error message is descriptive enough so the user knows how to fix it.

@elgertam elgertam self-assigned this May 28, 2019
@elgertam
Copy link
Member

Pull request to resolve this issue at #35

@elgertam
Copy link
Member

One question I have is how we'd like to handle invalid files that are added to the kiproject.json. The exception message informs users that they need to fix the filename and kiproject.json, but I think this could be frustrating for some users. On the other hand, most users probably won't have too many invalid filenames.

@hafen
Copy link
Member

hafen commented Jun 18, 2019

@elgertam don't we detect invalid file names before the entry is added to kiproject.json? If that's the case, we can just throw the exception and not write it to kiproject.json.

@elgertam
Copy link
Member

elgertam commented Jun 18, 2019

@hafen At the moment, we're not checking whether the filename is valid according to Synape's rules; we only check whether it exists locally. Part of the reason for that (as far as I can tell) is that rules for valid filenames on Synapse may not be the same as on other platforms. I could certainly add in the ability to check that a filename is valid based on the project type as specified in the kiproject.json, but it would be a bit more work.

@hafen
Copy link
Member

hafen commented Jun 18, 2019

Oh sorry I misunderstood. Where is the filename checking happening in #35?

Are Synapse's rules the lowest common denominator across all platforms?

@pcstout
Copy link
Member Author

pcstout commented Jun 24, 2019

@elgertam, @hafen For this issue I was thinking we could delegate the validation (as much as possible) to the providing service (Synapse in this instance). The implementation is probably catching a specific error from Synapse and prettying up the error (if needed at all -- I'm not sure what Synapse spits out but I think it's fairly explanatory).

It will be difficult to catch all invalid characters upon data_add since it can take a remote_uri (i.e., we don't even know the filename or path when adding the resource to the project). It should be as simple as data_remove -> change filename -> data_add for the user to fix filename issues.

@hafen
Copy link
Member

hafen commented Jun 25, 2019

I see. That sounds good to me then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants