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

fix(connectivity): return false from all_work_done() immediately after connecting #5102

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Dec 11, 2023

We do not want all_work_done() to return true immediately
after calling start_io(), but only when connection goes idle.

"Connected" state is set immediately after connecting to the server,
but it does not mean there is nothing to do.

This change make all_work_done() return false
from the Connected state and introduces a new Idle
connectivity state that is only set before connection
actually goes idle. For idle state all_work_done() returns true.

From the user point of view both old Connected state
and new Idle state look the same.

This has a regression test and was tested on iOS.

Was probably broken since #4804

@link2xt link2xt self-assigned this Dec 11, 2023
@link2xt link2xt requested review from Simon-Laux and Hocuri December 11, 2023 22:44
@link2xt link2xt marked this pull request as draft December 11, 2023 23:05
@link2xt link2xt force-pushed the link2xt/fix-connectivity-on-start-io branch from 02caa76 to 57267ed Compare December 11, 2023 23:13
@link2xt link2xt changed the title fix: set connectivity state to working immediately after connecting fix(connectivity): return false from all_work_done() immediately after connecting Dec 11, 2023
@link2xt link2xt marked this pull request as ready for review December 11, 2023 23:13
Copy link
Member

@Simon-Laux Simon-Laux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes iOS notifications for me, though I still would rather do #4420 in the long term instead of relying on the events here.

@link2xt link2xt force-pushed the link2xt/fix-connectivity-on-start-io branch from 55f5156 to 3067e38 Compare December 12, 2023 02:04
…r connecting

We do not want all_work_done() to return true immediately
after calling start_io(), but only when connection goes idle.

"Connected" state is set immediately after connecting to the server,
but it does not mean there is nothing to do.

This change make all_work_done() return false
from the Connected state and introduces a new Idle
connectivity state that is only set before connection
actually goes idle. For idle state all_work_done() returns true.

From the user point of view both old Connected state
and new Idle state look the same.
@link2xt link2xt force-pushed the link2xt/fix-connectivity-on-start-io branch from 3067e38 to 828cc1f Compare December 12, 2023 02:20
@link2xt link2xt merged commit 828cc1f into main Dec 12, 2023
38 checks passed
@link2xt link2xt deleted the link2xt/fix-connectivity-on-start-io branch December 12, 2023 02:51
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.

2 participants