MerginMaps / MerginMaps/mobile
Android: Adding same gallery photo twice to a feature shares sketches; only one file remains after sync
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 388
- Forks
- 87
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 20
Description
Description
When the same image is attached twice to the same point feature from the device gallery, and a separate photo sketch is drawn on each, the app treats both attachments as the same underlying photo:
- Photo sketch annotations are effectively shared / copied between them (second sketch overwrites or merges).
- After synchronization, only a single photo file is present in the project on the server (second attachment not preserved as a distinct file).
This causes data loss (loss of the second annotated variant) and misleading UI (appears like two attachments locally before sync).
Environment
staging
Application (+ app version, build, operating system)
- Mergin Maps Mobile (Android)
- App version: 2025.6.0 (714011)
- Device: Samsung Galaxy Tab Active5, Android 14
- Test project: tester-ws-1/test_photo-sketches
Steps to reproduce
- Open project
tester-ws-1/test_photo-sketcheson Android. - Add a point feature in layer "point_photo2_layer".
- Add a photo from device gallery (Photo A).
- Add a second attachment to the same feature by selecting the SAME gallery image (Photo A again).
- Add photo sketches to both photos
- Observe both attachments locally (they appear as two).
- Sync the project.
- Check record in QGIS -> only one picture with both sketches was added to the project folder.
Actual results
- The two attachments are not truly independent: the photo sketch from one appears on (or overwrites) the other.
- After sync, only one physical photo file is stored on the server (second instance not duplicated).
- The second distinct sketch (annotation changes) is lost or merged—cannot retrieve both annotated variants.
Expected results
- Each time a user attaches a photo—even if sourced from the same gallery image—it should be treated as a distinct attachment instance with its own:
- Stored file (unique filename)
- Independent sketch layer / annotation data
- Sync should preserve both annotated variants separately (e.g.
photoA.jpgandphotoA_2.jpgor hashed unique names). - No cross‑contamination of sketches between distinct attachments.
- UI should reflect any deduplication (if intended) explicitly; otherwise avoid silent de-duplication.
Screenshots or logs
Mobile app:
https://github.com/user-attachments/assets/442d5a88-d3b2-4e7e-82cb-7df53d5bc483
QGIS:
Conclusion
Created by GitHub Copilot and supervised by a human test analyst.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named in the report. Start by reproducing the issue in tester-ws-1/test_photo-sketches on Android, then trace how repeated gallery attachments, photo sketches, and synchronization are handled. Done means both attachments retain independent sketches and remain as separate files after sync.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- data, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100