Crash when geometries are too complex to enconde in the QR code
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start at encodeQrBitmap in QrCodeGenerator.android.kt:38 and follow its use from GroundQrCode.kt:67. Reproduce the crash with oversized geometry or long survey data, then verify that the QR-code flow handles the ZXing WriterException instead of crashing.
Written by the indexing model from the issue text.
Description
The QR code is missing error handling when the encoded data is too large. This could be due to geometries with many vertices or long LOI/survey names, which can make the geoJSON too big to be displayed as a QR code.
Fatal Exception: com.google.zxing.WriterException: Data too big
at com.google.zxing.qrcode.encoder.Encoder.chooseVersion(Encoder.java:320)
at com.google.zxing.qrcode.encoder.Encoder.recommendVersion(Encoder.java:218)
at com.google.zxing.qrcode.encoder.Encoder.encode(Encoder.java:152)
at com.google.zxing.qrcode.QRCodeWriter.encode(QRCodeWriter.java:78)
at org.groundplatform.ui.components.qrcode.QrCodeGenerator_androidKt.encodeQrBitmap(QrCodeGenerator.android.kt:38)
at org.groundplatform.ui.components.qrcode.GroundQrCodeKt$GroundQrCode$qrBitmap$2$1$1.invokeSuspend(GroundQrCode.kt:67)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:807)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
- Dominant language
- Kotlin
- Stars
- 294
- Forks
- 149
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
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.
More from google/ground-android
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
google/ground-android#3935 ·
-
type: bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
google/ground-android#3934 ·
-
type: code health
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
google/ground-android#3930 ·
-
google/ground-android#3839 · 1 assignee ·
-
type: code health
Difficulty 3/5 1-2 days Newbie friendliness 55/100
google/ground-android#3807 · 1 comment ·
All issues in google/ground-android
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Issue: Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
OpenAPITools/openapi-generator#24978 ·
-
helsemelding-json-schema json-schema-core
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
contributor: external needs review
Difficulty 2/5 1-3 hours Newbie friendliness 82/100