bluetooth scan fails silently
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- android, cpp
- Domain
- mobile-dev
Research direction
Start with app/bluetoothdiscoverymodel.cpp:28-32 and 102-121, then inspect the spinner in app/qml/gps/MMBluetoothProviderDrawer.qml:78. Reproduce the Android flow with location disabled and trace the synchronous discovery error and retry path. Done means error #6 reaches the drawer, the spinner stops with actionable guidance, retry works after fixing the setting, and the log includes errorString().
Written by the indexing model from the issue text.
Description
Description
When Bluetooth device discovery fails to even start, the app tells the user nothing and gets stuck
showing "Scanning for devices…" over an empty list, forever. There is no way for the user to
learn what is wrong, because the cause is never surfaced.
Internal support ticket: https://odoo.lutraconsulting.co.uk/odoo/all-tickets/16924
2026-08-26T13:21:42.435Z Bluetooth discovery: Error occured during device discovery, error code #6
2026-08-26T13:21:42.436Z Bluetooth discovery: Started discovering devices, method 3
Environment
Production
Application (+ app version, build, operating system)
- Mergin Maps mobile 2026.3.2 (839651)
- Android-specific
Probably, it only became reachable in practice once Qt 6 added
Steps to reproduce
- Bluetooth switched on. At least one discoverable Bluetooth device nearby.
- Open Mergin Maps and grant the Nearby devices permission when prompted (this is
BLUETOOTH_SCAN+BLUETOOTH_CONNECT- it must be granted, otherwise you hit the separate,
correctly-handled "Bluetooth permission is required" branch. - Now turn location off, either way round - both produce error
#6:- a) System Location master switch off - Settings → Location → Use location
- b) Settings → Apps → Mergin Maps → Permissions → Location → Don't allow
- In the app: Settings → Manage GPS receivers → Connect new receiver → Bluetooth.
Actual results
Empty device list with "Scanning for devices…" spinning indefinitely. No message, no hint that location is involved, even after the user fixes the location setting and returns to the screen - the model still believes it is discovering, so nothing restarts it.
The log contains error code #6 and nothing else actionable.
Expected results
The drawer stops the spinner and tells the user what to do - for error #6. Retrying after the user fixes the setting should work without reopening the app.
The log could carry errorString() so support can distinguish "location permission not granted" from "location service turned off" without a round trip to the customer.
Extra debug info
Three separate defects combine here:
- The discovery error never reaches QML.
BluetoothDiscoveryModelhas no error signal — theerrorOccurredhandler only writes to the log (app/bluetoothdiscoverymodel.cpp:28-32). The drawer therefore cannot say anything. - The model gets stuck in
discovering == true. On Android the error is delivered synchronously from insideQBluetoothDeviceDiscoveryAgent::start(), andsetDiscovering()assignsmDiscoveringonly afterstart()returns (app/bluetoothdiscoverymodel.cpp:102-121). The re-entrantfinishedDiscovery()hits themDiscovering == discoveringearly-return and does nothing; the outer call then setsmDiscovering = true. The footer spinner (app/qml/gps/MMBluetoothProviderDrawer.qml:78) never goes away. - The log throws away the one piece of information support needs. We log the numeric code but not
errorString()(app/bluetoothdiscoverymodel.cpp:30). Error#6(LocationServiceTurnedOffError) has two distinct causes in Qt's Android backend — location permission not granted, and the device-wide location service being off — and the code alone cannot tell them apart.
- Dominant language
- C++
- Stars
- 389
- Forks
- 88
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from MerginMaps/mobile
-
bug ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
MerginMaps/mobile#4669 ·
Maintainers usually reply within 1 day
-
bug Good first issue ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MerginMaps/mobile#4665 ·
Maintainers usually reply within 1 day
-
bug ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MerginMaps/mobile#4647 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
MerginMaps/mobile#4727 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
MerginMaps/mobile#4726 ·
Maintainers usually reply within 1 day
All issues in MerginMaps/mobile
Similar issues
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31098 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
bug chart-audit
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
godotengine/godot#124120 ·
Maintainers usually reply within 1 day
-
Component: R Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/arrow#51695 · 1 comment ·
Maintainers usually reply within 1 day