Cwa-app-ios: ENACommunity build: MockExposureManager seems broken, does not call its completion handler

Created on 3 Feb 2021  路  8Comments  路  Source: corona-warn-app/cwa-app-ios

Avoid duplicates

  • [ ] Bug is not mentioned in the FAQ
  • [ ] Bug is not already reported in another issue

Technical details

  • Device name: XCode Simulator (for iPhone 8)
  • iOS Version: XCode Simulator (for iOS 14.3)
  • App Version: at tag: v1.11.0

Describe the bug

I have checked-out the cwa-app-ios code at tag "v1.11.0", compiled it for ENACommunity, and now run it on a XCode Simulator for iPhone 8 / iOS 14.3.
I am watching the screen of the simulation and the debug messages, and see the following:

1) Risk check is not successfull, the procedure times out after 8 minutes. I have started debugging. Download of hourly and daily packages is reported successfull, then it calls MockExposureManager.detectExposures, but it seems the mock never calls the completion.

2) When I single-step / setup many breakpoints, and the timeout happens before the mock even starts to detect exposures; in this case the timeout does not prevent the mock from starting, and the check continues forever (well, till I brute-force stop it).
On a first glance it looks like the timeout handling has a race condition in this case (but maybe this is intended, and the timeout shall cover only download from the server?) => moved this part to separate ticket #1941

Steps to reproduce the issue (1)

  • Checkout code at tag "v1.11.0"
  • compile for ENACommunity
  • setup breakpoints as follows:

    • (a) MockExposureManager line 63 (func detectExposures)

    • (b) ExposureDetectionExecutor line 74 (the completion handler)

    • (c) RiskProvider line 169 (the timeout handler)

  • run the simulation and watch breakpoints:

    • hit breakpoint (a) at MockExposureManager.detectExposures

    • continue execution

    • see simulation screen with message "Check is running ..."

    • wait 8 minutes

    • hit breakpoint (c) at timeout handler

    • continue execution

    • see simulation screen with message "Exposure check failed"

Note: breakpoint (b) never triggers.

Expected behaviour

The mock should call its completion handler.

Note: I have split the ticket and moved the following part to #1941

## Steps to reproduce the issue (2)
* as above: checkout code at tag "v1.11.0" and compile for ENACommunity
* setup breakpoints (a), (b), (c) as above, plus:
~~ * (d) RiskProvider line 188 (during package download)~~
* run the simulation and watch breakpoints:
* hit breakpoint (d) during package download
* wait more than 8 minutes at the breakpoint, then continue execution
* hit breakpoint (c) at timeout handler
* continue execution
* hit breakpoint (a) at MockExposureManager.detectExposures
* continue execution
* see simulation screen with message "Check is running ..."
* wait forever

Note: breakpoint (b) never triggers.
## Expected behaviour
Either the mock execution should be covered by the overall timeout, or setup its own timeout.

Possible Fix

Additional context

I am aware that the ENACommunity build and the mock have not the highest priorities.
Still I can volunteer to look deeper into this, but first would like to know:

  • is my expectation wrong / misunderstanding on my side?
  • is this already analysed / improved / fixed (and I should avoid duplicate effort)?

Internal tracking ID: EXPOSUREAPP-5006

Fix 1.13 bug mirrored-to-jira

Most helpful comment

Thanks @dsarkar.

I'll let you know as soon as I have any more information (or maybe questions) on this.

All 8 comments

Hi @ndegendogo,

thanks for contribution. We have forwarded this to the developers. As usual any new development on this topic will be published there. Best, DS


Corona-Warn-App Open Source Team
Internal tracking ID: EXPOSUREAPP-5006

@ndegendogo I got some feedback. The devs would appreciate your contribution and to look deeper into it, and if applicable provide a PR. My understanding is that your two questions above are answered all with "no".

Thanks @dsarkar.

I'll let you know as soon as I have any more information (or maybe questions) on this.

I am splitting this ticket now. Actually, I made 2 observations, and they should be discussed separately.

  • The first issue "MockExposureManager for ENACommunityBuild does not call its completion handler" stays here in this ticket.
  • The second issue "Timeout for risk check seems to behave inconsistently" needs more analysis and discussion, I have split it and moved it to #1941.

So ... I now opened a PR (https://github.com/corona-warn-app/cwa-app-ios/pull/1943).

One question still: if I understand correctly, I am supposed to set a label to this PR - but how?

@ndegendogo

Docs are also outdated regarding this, community members can't set labels...

@Ein-Tim thanks for the clarification!

Docs are also outdated regarding this, community members can't set labels...

@heinezen please consider to add a clarifying comment to the contribution guidelines / item 3 "Set label ..." ? - Thanks!

Was this page helpful?
0 / 5 - 0 ratings