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

Present Publisher as offline to Subscribers on loss of connectivity on the Subscriber's side #855

Merged
merged 19 commits into from
Dec 22, 2022

Conversation

QuintinWillison
Copy link
Contributor

@QuintinWillison QuintinWillison commented Dec 16, 2022

More of a refactor than perhaps entirely necessary but I was finding the current subscriber state emission code difficult to follow and reason about.

In the same vein, I've also removed a number of tests which were (in my opinion) adding little value to the maintainability of the codebase as we go forwards - I'm sure they were helpful when creating the worker queue infrastructure but at this point they were a major barrier to refactoring.
UPDATE: Tests reinstated in fca0789

Fixes #833.

…me unnecessary indirection.

There are still improvements I could make, but I think this makes the code easier to follow, especially now that we have a single emitEventsIfRequired() method.

I ended up removing all of the worker queue tests as it was unclear to me what value they were adding to the codebase.
They were hampering refactoring speed, due to my change to the SubscriberProperties constructor signature.
@QuintinWillison QuintinWillison self-assigned this Dec 16, 2022
@github-actions github-actions bot temporarily deployed to staging/pull/855/dokka December 16, 2022 16:03 Inactive
… uniquely identifying the source of presence messages.
…er instances.

So, for example, this fixes behaviour for the sequence:
- Publisher with Member Key A:1 Enters Presence
- Publisher with Member Key A:2 Enters Presence
- Publisher with Member Key A:1 Leaves Presence

Previously this would flag "the" publisher as offline.
With this change, it will now continue to flag "the" publisher as online.
…e our local connectivity state being offline.
@github-actions github-actions bot temporarily deployed to staging/pull/855/dokka December 19, 2022 11:30 Inactive
@QuintinWillison QuintinWillison marked this pull request as ready for review December 19, 2022 12:35
Copy link
Contributor

@ikbalkaya ikbalkaya left a comment

Choose a reason for hiding this comment

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

As this PR contains mostly refactoring code, I wasn't able to confirm where exactly the change happened

I assume that's isPublisherVisible but wasn't sure - could you please provide an explanation to PR description so this is more clear?

Also about tests, as far as I can see they do test the individual workers, I think they are still important as they protect the correct functioning of individual workers.

@github-actions github-actions bot temporarily deployed to staging/pull/855/dokka December 20, 2022 14:39 Inactive
@QuintinWillison
Copy link
Contributor Author

Recognising the push back from both @ikbalkaya and @davyskiba on my removal of tests, I'm going to move this PR back to Draft state while I look at those again.

@QuintinWillison QuintinWillison marked this pull request as draft December 20, 2022 14:47
@github-actions github-actions bot temporarily deployed to staging/pull/855/dokka December 20, 2022 14:49 Inactive
I initially removed them in 130dfa6 but, quite rightly, had push back from other members of the team so I have put time into reinstating them which required refactors to reflect my changes elsewhere.
@github-actions github-actions bot temporarily deployed to staging/pull/855/dokka December 21, 2022 12:34 Inactive
@QuintinWillison QuintinWillison dismissed ikbalkaya’s stale review December 22, 2022 12:31

Ikbal is on holiday and we need to get this pull request merged.

@QuintinWillison QuintinWillison merged commit 17a8a26 into main Dec 22, 2022
@QuintinWillison QuintinWillison deleted the publisher-presence-at-subscriber branch December 22, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Subscriber, upon losing connectivity, continues to show the Publisher as online
3 participants