Skip to content

Align mobile regex with server regex#4590

Open
xkello wants to merge 1 commit into
masterfrom
bugfix/update-project-name-regex
Open

Align mobile regex with server regex#4590
xkello wants to merge 1 commit into
masterfrom
bugfix/update-project-name-regex

Conversation

@xkello

@xkello xkello commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

  • Removed the special-character blacklist from reForbiddenNames in CoreUtils::isValidName()
  • Added a new whitelist regex, reValidCharacters, allowing only word characters, whitespace, hyphens, and dots (^[\w\s\-\.]+$) — matching the server's has_valid_characters() check
  • isValidName() 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 whitelist

Expected 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

Screenshot_20260710-082727 Screenshot_20260710-082717 Screenshot_20260710-081406

@xkello xkello requested review from Withalion and Copilot and removed request for Copilot July 10, 2026 06:34
@github-actions

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build Build failed or not found. #7011
linux Build Build failed or not found. #7037
win64 Build 📬 Mergin Maps 62091 win64 Expires: 08/10/2026 #6209
Android Build 📬 Mergin Maps 832111 APK [armeabi-v7a] Expires: 08/10/2026 #8321
📬 Mergin Maps 832111 APK [armeabi-v7a] Google Play Store #8321
Android Build 📬 Mergin Maps 832151 APK [arm64-v8a] Expires: 08/10/2026 #8321
📬 Mergin Maps 832151 APK [arm64-v8a] Google Play Store #8321
iOS Build 📬 Build number: 26.07.926311 #9263

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

Successfully merging this pull request may close these issues.

1 participant