Align mobile regex with server regex#4590
Open
xkello wants to merge 1 commit into
Open
Conversation
📦 Build Artifacts Ready
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Aligns the mobile app project name validation with the server validation rules. Previously, the mobile app used a different (blacklist-based) character validation than the server (whitelist-based), which allowed users to create local projects with names containing characters the server would reject - meaning the project could never be pushed/synced because some characters were missing from the mobile regex.
Tickets: #4516, #4365
Current behaviour
The mobile app only blocked a fixed set of blacklisted special characters (
@#$%^&*(){}[]\/|+=<>~?:;,`'"etc.). Any character not explicitly listed was allowed, even if the server would reject it later.This meant a user could successfully create a local project with an invalid name (e.g. containing
!), work with it locally, and only discover the mismatch when sync to the server failed.What changed
reForbiddenNamesinCoreUtils::isValidName()reValidCharacters, allowing only word characters, whitespace, hyphens, and dots (^[\w\s\-\.]+$) — matching the server'shas_valid_characters()checkisValidName()now requires both checks to pass: the name must not match any forbidden pattern (reserved words, OS device names, leading space/dot) and must match the valid-character whitelistExpected behaviour
Project names can now only contain characters the server also accepts, preventing the local-creation/server-rejection mismatch
Previously problematic characters like
'or!are now handled consistently - screenshot attached showing project creation working correctly with these characters