Corrupt certificate export PDF
MikeMcC399 opened this issue ยท 10 comments
Avoid duplicates
- Bug is not mentioned in the FAQ
- Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
- Bug is not already reported in another issue
This problem was mentioned in #5350 (comment)
Technical details
- Device name: Pixel 3a emulator and Samsung Galaxy A52 5G
- Android version: 12
- App version: 2.24.2 and 2.26.x
Describe the bug
Directly after updating to 2.24.2 an exported certificate is corrupt and cannot be read by Adobe Acrobat DC, which outputs the error message:
"There was an error processing a page. There was a problem reading this document (109)."
When this error occurs on 2.24.2, the exported PDF file has a size of 676 KB (same size as on 2.23.2), otherwise it has a size of 121 KB.
Steps to reproduce the issue
The problem occurs directly after a version update from CWA Android 2.23.2 to 2.24.2
- Install 2.23.2
- Single certificate export to Google Drive (PDF is 676 KB and good)
- Leave 2.23.2 open and update to 2.24.2
- Single certificate export to Google Drive (PDF is 676 KB and unreadable)
- Repeat single certificate export to Google Drive (PDF is 120 KB and readable)
Detailed steps below:
On Desktop
- Use Android Studio Device File Explorer to transfer German EU vaccination certificate PDF to the emulator
In CWA App
- Tap Scan
- Tap Open File
- Navigate to vaccination certificate in File app and tap on file, tap "Continue"
- Tap three-dot symbol
- Select Display Print Version, tap "Next"
- Tap Share symbol
- Tap Drive symbol
- Tap Save
On Desktop
- Open Drive https://drive.google.com/drive/my-drive
- Download
- Attempt to open saved PDF with Adobe Acrobat DC
In some cases an error message "There was an error processing a page. There was a problem reading this document (109)." is displayed, in other cases there is no problem.
Expected behavior
An exported certificate should always be readable.
Internal Tracking ID: EXPOSUREAPP-13673
@Ein-Tim using an SVG instead of raw PDF (bitmap) generates:
1- smaller PDF in terms of size
2- higher quality PDF (try to zoom in) in PDF generated before 2.24, PDF will show pixels in big zooms
We moved to this approach ,since generating multiple certificates would require optimisation in the size.
CovPassApp
is using this approach also.
@MikeMcC399 I can't tell what is the issue with the information you provided,
- could you please tell whether you were trying to export single or multiple certificates?
- what version do you have of WebView on the emulator ?
- does it happen on real devices ? (emulators are not always reliable)
I can't tell what is the issue with the information you provided,
- could you please tell whether you were trying to export single or multiple certificates?
This is a single certificate export. See steps 5. & 6.
- what version do you have of WebView on the emulator ?
Android System WebView
on the Pixel 3a emulator is up-to-date from the Google Play Store with version 103.0.5060.71
- does it happen on real devices ? (emulators are not always reliable)
I have also seen it happen on a real device (Samsung Galaxy A52 with Android 12). Unfortunately I haven't found a way to reliably reproduce the issue, neither on an emulator, nor on a physical device.
With all these issues reported with the new way certificates are exported, would it make sense to roll back the change in 2.25?
Apart from this sporadic issue of corrupt export PDFs, all the other certificate issues are cosmetic. If the app were to be rolled back to 2.23.2 functionality then the new function of exporting multiple certificate would be lost. I have not seen anybody else report about corrupt certificates. Have you seen any reports about this from other people?
I was only thinking about rolling back the change due to
But if these issues will all be fixed soon, rolling back the change doesn't seem necessary.
I managed to reproduce the error. I thought it was strange that 2.24.2 was producing a PDF with the same size (676 KB) as the file produced by 2.23.2, when the correct PDFs from 2.24.2 are only 120 KB large.
The repro steps are:
- Install 2.23.2
- Single certificate export to Google Drive (PDF is 676 KB and good)
- Update to 2.24.2
- Single certificate export to Google Drive (PDF is 676 KB and unreadable)
- Repeat single certificate export to Google Drive (PDF is 120 KB and readable)
It looks like there may be a buffer or temporary storage which is not getting cleared out after the version update.
I could not reproduce when I closed CWA 2.23.2 (Android Close All) before updating to 2.24.2, so it seems this is quite an edge case I stumbled on.
@MikeMcC399 Thanks, your findings were documented in the internal ticket.
The issue is also reproducible upgrading from deviceForTesters-debug build 2.23.2-RC0 to the latest 2.26.0-RC0.
In 2.26.0 after exiting the "Print Version" screen, going back to the QR code then re-selecting "Display Print Version" followed by Share will clear the condition.
So the mitigation is simply to try again from the beginning. The issue should still be looked at, even though it probably will not affect many users. There is something unclean going on.
This is still reproducible updating from 2.23.2 to 2.26.0-RC1 however the problem only occurs if the update to 2.26.0 is done when the 2.23.2 version is still showing the exported certificate. If the 2.23.2 app is returned to the "Status" screen before updating to 2.26.0 then the certificate export is not corrupted.
This is quite a corner case. Most users will not be updating from 2.23 any more. They are very likely to be using 2.24. On top of that they would need to be caught exporting a certificate at the same time as updating from an old version. So the likelihood of any user seeing this issue is extremely small.
Please feel free to label with
wontfix
@MikeMcC399 I was able to reproduce the issue, I think for end user this case won't be possible. As you mentioned already user should stay on the preview screen of the PDF and then update app either from Android studio or using command line to push the new APK.
BTW we clear the PDF while leaving the preview screen, in this case the event where generated PDF is cleaned up did not get the change to execute ,because the App got killed.
I will close it as you suggested