Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • TousAntiCovid Verif iOS TousAntiCovid Verif iOS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • TousAntiCovid V茅rif
  • TousAntiCovid Verif iOSTousAntiCovid Verif iOS
  • Issues
  • #12

Closed
Open
Created Mar 28, 2022 by Martin@x-MBonni

Positive tests collected in the 11 days before daylight saving time started are not always detected as valid

Hi everyone 馃憢

It looks like there's an issue with timezones while computing the validity of recovered positive tests. My guess is that it's due to the daylight saving time and that it offsets the results by 24h (a positive test is recognised as valid after 12 days instead of 11).

For an example, assuming you got tested positive on March 18 at 2pm and daylight saving time happened on March 27, it looks like the code is doing something like this (pseudoCode):

let samplingDate = "2022-03-18"
let samplingDateUTC = Date(dateString: samplingDate) // 2022-03-18T00:00:00 UTC
let samplingDateUTCEndOfDay = samplingDate.roundingToEndOfDay() // 2022-03-18T22:59:59 UTC
// At this point, minimumValidity is now pointing at March 30th because the time difference is now +2 and not +1
let minimumValidity = samplingDateUTCEndOfDay.dateByAddingDays(11) // 2022-03-29T22:59:59 UTC
// minimumValidityBeginningOfDay is still March 30
let minimumValidityBeginningOfDay = minimumValidity.roundingToBeginningOfDay() // 2022-03-29T22:00:00 UTC

// Assuming the check is done on March 29, 2pm
let today = Date() // 2022-03-29T14:00:00+0200
// The pass should be valid except it is not because minimumValidityBeginningOfDay points at March 30th
today >= minValidity // false here :-( 

TBH, I'm not 100% sure what's happening and why the rounding is necessary but this is the furthest I could investigate. Running the same test on the Android App doesn't have the same issue, I'm guessing because it doesn't have this roundingToEndOfDay

Let me know if you need more details! Hope this helps,

Martin

Edited Mar 28, 2022 by Martin
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking