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

Filter out system app when there are multiple active apps #204

Merged
merged 1 commit into from
Aug 27, 2019

Conversation

fr0l
Copy link

@fr0l fr0l commented Aug 26, 2019

Issue:
on iOS 13 [FBXCAXClientProxy.sharedClient activeApplications] returns multiple entries (in my case - two).
And there are situations when the firstObject is SpringBoard - i.e. system application.
This prevents proper list of elements.

Fix:
Filter out system applications from list of activeApplications in case there are more than one item.

@fr0l fr0l changed the title Filter out system application when there are multiple active applications Filter out system app when there are multiple active apps Aug 26, 2019
@fr0l fr0l force-pushed the findActiveApplicationIOS13 branch from 1deb90e to 2a9ea96 Compare August 26, 2019 10:57
@fr0l fr0l force-pushed the findActiveApplicationIOS13 branch 2 times, most recently from 4e6dd31 to b9caf24 Compare August 26, 2019 18:07
@fr0l fr0l force-pushed the findActiveApplicationIOS13 branch from b9caf24 to ed5a843 Compare August 26, 2019 18:10
@fr0l
Copy link
Author

fr0l commented Aug 26, 2019

the test testSettingsAppCanBeOpenedInScopeOfTheCurrentSession is a bit flaky. it should wait until event that the required application is active, and instead — now it just waits 5 seconds in this part of code:

  [[[FBRunLoopSpinner new]
    timeout:5]
   spinUntilTrue:^BOOL{
     return [FBXCAXClientProxy.sharedClient activeApplications].count == 1;
   }];

Locally, just to test, if I replace that spinUntilTrue with a simple sleep(5), then the test will pass 🤷‍♂

I've reverted the spin check (from what I've committed initially) (which is actually what it should be)

     return [FBXCAXClientProxy.sharedClient activeApplications].count > 0;

to what it was

     return [FBXCAXClientProxy.sharedClient activeApplications].count == 1;

(and now it actually sleeps 5 seconds, because the activeApplications.count is > 1 for iOS 13 when switching back and forth from applications within one session)

and later might see how to make test testSettingsAppCanBeOpenedInScopeOfTheCurrentSession not flaky.

@mykola-mokhnach
Copy link

Perhaps, it makes sense to change the test itself depending on the iOS version?

@fr0l
Copy link
Author

fr0l commented Aug 26, 2019

ideally, test should not depend on iOS version. anyway, it's a separate issue.

@mykola-mokhnach
Copy link

and now it actually sleeps 5 seconds, because the activeApplications.count is > 1 for iOS 13 when switching back and forth from applications within one session

I don't like this fact very much. Is there any way to reduce the delay?

@mykola-mokhnach
Copy link

Let's merge this PR for now. I'll create a separate issue for 5 seconds delay.

@fr0l
Copy link
Author

fr0l commented Aug 27, 2019

and now it actually sleeps 5 seconds, because the activeApplications.count is > 1 for iOS 13 when switching back and forth from applications within one session

I don't like this fact very much. Is there any way to reduce the delay?

@mykola-mokhnach Yes, i also didn't like the fact that it sleeps for 5 seconds. that's why I've changed the comparison from == 1 to > 0. (it was kind of a quick fix)

I think it's good to determine requirements here and edge cases.

  • One of edge cases is that in iOS 13 there might be 2 applications active (one of them is system app. I don't know is it a iOS Beta bug or not. we'll see shortly with Xcode GoldenMaster)
  • Also I haven't looked yet into iPad and it's split screen view — with split screen view the list activeApplications should contain more that one.

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

Successfully merging this pull request may close these issues.

3 participants