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

App is slow to resume. It even sometimes fails to resume. #2793

Closed
manuroe opened this issue Oct 22, 2019 · 2 comments · Fixed by matrix-org/matrix-ios-sdk#738
Closed

App is slow to resume. It even sometimes fails to resume. #2793

manuroe opened this issue Oct 22, 2019 · 2 comments · Fixed by matrix-org/matrix-ios-sdk#738
Assignees
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@manuroe
Copy link
Member

manuroe commented Oct 22, 2019

The first incremental sync can be delayed for several seconds before being triggered. We can see no logs for several seconds in the app logs.
It looks like if there is a failure during those unknown steps, the app fails to resume. Only a clear cache can make it work again.

@manuroe manuroe added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Oct 22, 2019
@manuroe manuroe added this to the Sprint 23 - Stabilisation milestone Oct 22, 2019
@manuroe manuroe self-assigned this Oct 25, 2019
@manuroe
Copy link
Member Author

manuroe commented Oct 25, 2019

There are at least 2 issues:

  • the first /sync request is made only after the crypto module is fully started (which can trigger 2 successive requests)
  • Meanwhile some other HTTP requests are stacked which may delay the actual sending/processing of the /sync request

A typical HTTP requests sequence is:

10:56:38.472 [MXHTTPClient]_matrix/client/r0/voip/turnServer completed in 502ms
10:56:38.625 [MXHTTPClient]_matrix/client/unstable/devices/BCJUGLYRTV completed in 685ms
10:56:41.853 [MXHTTPClient]_matrix/client/unstable/keys/upload/BCJUGLYRTV completed in 1287ms
10:56:42.875 [MXHTTPClient]_matrix/client/unstable/keys/upload/BCJUGLYRTV completed in 1019ms
10:56:43.900 [MXHTTPClient]_matrix/client/unstable/room_keys/version completed in 999ms
10:56:42.909 [MXSession] resume the event stream
10:56:43.914 [MXHTTPClient]_matrix/client/r0/groups/+matrix:matrix.org/summary completed in 3522ms
10:56:43.918 [MXHTTPClient]_matrix/client/r0/groups/+test-fosdem-2019:matrix.org/summary completed in 3525ms
10:56:44.694 [MXHTTPClient]_matrix/client/r0/sync completed in 1785ms
10:56:44.772 [MXSession] Continue /sync with short timeout to get all to-device events
10:56:45.272 [MXSession] Do a server sync (catching up)
10:56:47.585 [MXHTTPClient] _matrix/client/r0/sync completed in 2313ms
10:56:47.588 [MXSession] Events stream resumed in 4680ms

@manuroe
Copy link
Member Author

manuroe commented Oct 25, 2019

Another sequence with requests number:

2019-10-25 11:55:30.756806 0200 Riot[8392:1775729] [MXHTTPClient] #0 - _matrix/client/unstable/devices/BCJUGLYRTV completed in 5067ms
2019-10-25 11:55:31.721041 0200 Riot[8392:1775729] [MXHTTPClient] #4 - _matrix/client/unstable/keys/upload/BCJUGLYRTV completed in 2641ms
2019-10-25 11:55:32.236685 0200 Riot[8392:1775729] [MXHTTPClient] #5 - _matrix/client/unstable/keys/upload/BCJUGLYRTV completed in 513ms
2019-10-25 11:55:32.722613 0200 Riot[8392:1775729] [MXHTTPClient] #3 - _matrix/client/r0/groups/+test-fosdem-2019:matrix.org/summary completed in 3797ms
2019-10-25 11:55:32.735048 0200 Riot[8392:1775729] [MXHTTPClient] #2 - _matrix/client/r0/groups/+matrix:matrix.org/summary completed in 3810ms
2019-10-25 11:55:33.349352 0200 Riot[8392:1775729] [MXHTTPClient] #6 - _matrix/client/unstable/room_keys/version completed in 1098ms
2019-10-25 11:55:49.201565 0200 Riot[8392:1775729] [MXHTTPClient] #7 - _matrix/client/r0/sync completed in 16939ms
2019-10-25 11:55:50.768422 0200 Riot[8392:1775729] [MXHTTPClient] #8 - _matrix/client/r0/sync completed in 914ms
...
2019-10-25 11:55:52.612787 0200 Riot[8392:1775729] [MXHTTPClient] #1 - _matrix/client/r0/voip/turnServer completed in 26888ms

/sync should have a better position

manuroe added a commit to matrix-org/matrix-ios-sdk that referenced this issue Oct 25, 2019
element-hq/element-ios#2793

There is no need to wait that crypto makes all its requests on a resume because it already made it (is, posting its device ids and one time keys) on a previous initial sync.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant