Invalid field name with unsupported characters accepted; project uploads but mobile app hangs when opening

Aperta
#817 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Riproduci il problema nel QGIS plugin creando un campo denominato Photo_: con un Attachment widget, configurando il pattern degli allegati mostrato e sincronizzando il progetto. Inizia tracciando dove vengono convalidati i nomi dei campi o gli schemi del progetto prima della sincronizzazione. Il completamento dovrebbe impedire l’uso di nomi non supportati prima della sincronizzazione oppure segnalarlo chiaramente, con una copertura per i caratteri riportati e un comportamento che eviti di produrre un progetto mobile inutilizzabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Description
A layer field whose name contains invalid / unsupported characters (tested: Photo_: — characters like : | ? " *) is not rejected or warned about by the QGIS plugin. The project syncs successfully to the server. When the project is downloaded in the Mergin Maps mobile app (Android/iOS) and opened, the app stays in an indefinite “opening” state (spinner) until forcibly killed. This creates a hidden data integrity / usability issue: plugin allows creation + upload of a schema that mobile cannot handle gracefully.

Environment
PROD

Application (+ app version, build, operating system)

  • QGIS version: 3.40.5-Bratislava
  • Plugin version: 2025.3.3
  • Desktop OS: macOS Sequoia 15.6 (reported)
  • Mobile platforms: Android + iOS (both hang)

Steps to reproduce

  1. In QGIS, create a new Mergin Maps project.
  2. Add a new layer and create a text field named exactly: Photo_: (an example containing a colon; other disallowed characters like | ? " * likely similar).
  3. Set the field’s widget to Attachment.
  4. Open Mergin Maps plugin settings and define a custom attachment naming pattern referencing that field, e.g.:
    @layer_name + '-' + @mm_username + '-' + format_date(now(),'ddMMyy_hhmm')
  5. Sync the project to the server — sync completes without validation error.
  6. On mobile (Android or iOS), download the project.
  7. Attempt to open the project.

Actual results

  • QGIS plugin shows no validation warning about the field name.
  • Sync succeeds; project is present on server.
  • Mobile app: after tapping the project to open, it remains stuck “opening” (spinner) indefinitely; no user-facing error, necessitating force-closing the app.
  • Project content never loads.

Expected results

  • Plugin should proactively validate field names (especially for layers with attachment widgets) and block or warn if unsupported characters are present before allowing sync.
  • Either:
    • (Blocking) Prevent sync until offending field names are renamed, listing all invalid characters detected.
    • (Sanitizing) Automatically map / escape invalid characters (with a clear transformation note) so mobile can open the schema.
  • Mobile app should not hang; if schema is invalid it should display a clear error (e.g., “Project schema contains unsupported field name: ‘Photo_:’”).

Screenshots or logs

Conclusion
Created by GitHub Copilot and supervised by a human test analyst.

Lingua principale
Python
Stelle
45
Fork
21
Merge medio
3g 13h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MerginMaps/qgis-plugin

Tutte le issue di MerginMaps/qgis-plugin

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.