Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving InfectionStatus .exposed after calling resetInfectionStatus #253

Open
alopezh opened this issue May 18, 2021 · 4 comments
Open

Comments

@alopezh
Copy link

alopezh commented May 18, 2021

Once a device has received the InfectionStatus .exposed we are trying to bring it back to .healthy status by calling the sdk function DP3TTracing.resetInfectionStatus()

Initially the device goes back to .healthy but after the app is closed and the sdk is initiallized again. func DP3TTracingStateChanged(_ state: TracingState) get the InfectionStatus .exposed with the same date as before.

This is a sumamry of the related logs:

2021-05-13T08:27:41+0200 debug ExpositionUseCase : New Tracing State --->
2021-05-13T08:27:41+0200 debug ExpositionUseCase : Status: exposed(days: [DP3TSDK.ExposureDay(identifier: BCEF6CC3-025B-4657-AFCB-8AAC9A1F9E49, exposedDate: 2021-05-12 00:00:00 +0000, reportDate: 2021-05-13 02:19:44 +0000, isDeleted: false)])
2021-05-13T08:27:41+0200 debug ExpositionUseCase : lastSync: Optional(2021-05-13 06:27:41 +0000)
2021-05-13T08:27:41+0200 debug ExpositionUseCase : tracingState active
2021-05-13T08:27:41+0200 debug ExpositionUseCase : <---
...
2021-05-13T08:27:41+0200 debug ExpositionCheckUseCase : Exposition outdated -->  resetInfectionStatus called
...
2021-05-13T08:27:41+0200 debug ExpositionUseCase : New Tracing State --->
2021-05-13T08:27:41+0200 debug ExpositionUseCase : Status: healthy
2021-05-13T08:27:41+0200 debug ExpositionUseCase : lastSync: Optional(2021-05-13 06:27:41 +0000)
2021-05-13T08:27:41+0200 debug ExpositionUseCase : tracingState active
2021-05-13T08:27:41+0200 debug ExpositionUseCase : <---
...
2021-05-13T09:25:17+0200 debug SetupUseCase : [DP3TSDK] retreiving status from SDK
2021-05-13T09:25:17+0200 debug SetupUseCase : [exposureNotificationTracer] calling ENMananger.setExposureNotificationEnabled true
2021-05-13T09:25:19+0200 debug SetupUseCase : didScheduleBackgrounTask
2021-05-13T09:25:21+0200 debug SetupUseCase : [exposureNotificationTracer] calling ENMananger.activate
...
2021-05-13T09:25:21+0200 debug ExpositionUseCase : New Tracing State --->
2021-05-13T09:25:21+0200 debug ExpositionUseCase : Status: exposed(days: [DP3TSDK.ExposureDay(identifier: BCEF6CC3-025B-4657-AFCB-8AAC9A1F9E49, exposedDate: 2021-05-12 00:00:00 +0000, reportDate: 2021-05-13 02:19:44 +0000, isDeleted: false)])
2021-05-13T09:25:21+0200 debug ExpositionUseCase : lastSync: Optional(2021-05-13 06:27:41 +0000)
2021-05-13T09:25:21+0200 debug ExpositionUseCase : tracingState active
2021-05-13T09:25:21+0200 debug ExpositionUseCase : <---

Regards

@stmitt
Copy link
Contributor

stmitt commented May 19, 2021

what version of the SDK are you experiencing this issue with?

@alopezh
Copy link
Author

alopezh commented May 19, 2021

The version we are using is 2.1.0

@stmitt
Copy link
Contributor

stmitt commented May 21, 2021

resetInfectionStatus does currently not delete the exposure Days. If you use resetExposureDays all exposure days will be deleted from the local storage.

@alopezh
Copy link
Author

alopezh commented May 24, 2021

We have used previously DP3TTracing.reset() that internally calls DP3TTracing.resetExposureDays() and the result is the same. Tracing state becomes healthy. We tried just resetting infection status because with this piece of code.

class ExposureNotificationMatcher: Matcher {
...
func receivedNewData(_ data: Data, now: Date = .init()) throws -> Bool {
        ...
                    updateExposureDays(with: windows, now: now)
        
                    if exposureDayStorage.getDays() != exposureDays {
                        // a new exposure was found
                        logger.log("finishing matching session with new exposure(s)")
                        return true
                    }
        
                    logger.log("finishing matching session with no new exposures")
        ...
}
...
}

We suposed the exposure days should be not deleted to keep the state healthy

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants