corona-warn-app / cwa-documentation

Project overview, general documentation, and white papers. The CWA development ends on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
3.28k stars 344 forks source link

RAT profile QR code is regenerated every time the screen is opened #792

Closed Ein-Tim closed 2 years ago

Ein-Tim commented 2 years ago

Avoid duplicates

Technical details

Describe the bug

The QR code on the RAT profile screen is regenerated every time the screen is opened.

Here are two videos:

https://user-images.githubusercontent.com/67682506/147862890-3a2dbbd0-0054-4906-bfa3-282560581321.mov

https://user-images.githubusercontent.com/67682506/147862888-1415d3d7-cbfb-4f3b-9fac-305fbfbbe835.mp4

Steps to reproduce the issue

  1. Open the Corona-Warn-App
  2. Click on the "Manage Your Tests" box
  3. (Scroll down &) click on "Rapid Test Profile"
  4. Generate a new profile if one isn't already generated
  5. Take a look at the lower left part of the QR code
  6. Close the view
  7. Open the view again
  8. Take another look at the lower left part of the QR code
  9. Notice that the QR code has changed

Expected behaviour

The QR code should only change if the data stored in the QR code has changed.

Additional context

It seems like the REV field in the v-card changes every time, however, If I understand the documentation on https://datatracker.ietf.org/doc/html/rfc6350#section-6.7.4 correctly, this field should only change if the rest of the data (e.g. BDAY) changes.


Internal Tracking ID: EXPOSUREAPP-11133

MikeMcC399 commented 2 years ago

@Ein-Tim As far as the Android app is concerned, it seems that this is "works-as-designed".

See https://github.com/corona-warn-app/cwa-app-android/blob/main/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/coronatest/antigen/profile/VCard.kt#L34

val rev = now.toString(revDateFormatter) // Time the vCard was updated

where it uses the current time to build that field in the QR code.

MikeMcC399 commented 2 years ago

Just for comparison, when Microsoft Outlook creates a VCARD .vcf file from a contact it also uses the current time for the REV: field, not the "Modified" date/time-stamp.

Jo-Achim commented 2 years ago

But... somehow I have a bad feeling when data (in this case a QR code) that is supposed to provide one specific information changes!? (Without changing the basic 'in fact' information.)

larswmh commented 2 years ago

Hi @Ein-Tim, thanks for your report. We have created an internal ticket and will raise this topic internally. Internal Tracking ID: EXPOSUREAPP-11133


Corona-Warn-App Open Source Team

MikeMcC399 commented 2 years ago

The real test whether this is a bug, is if it causes a problem when reading the Rapid Test Profile at a testing center. If the test center software does not use the REV field or does not care about its actual value, then it could be omitted from the vCard QR code produced by CWA.

According to the standard, which @Ein-Tim quoted (https://datatracker.ietf.org/doc/html/rfc6350), the field is optional. (See the definition of REV in section 6.7.4 which specifies a cardinality of *1 for this field. and the definition of Property cardinalities in section 3.3 where *1 is equated to "Exactly one instance per vCard MAY be present".)

dsarkar commented 2 years ago

No problems have been reported, It currently works as designed/intended.

Ein-Tim commented 2 years ago

Okay, closing.