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

Automatically re-join calls after code-push-triggered reload #1324

Closed
wants to merge 1 commit into from

Conversation

ebroder
Copy link
Member

@ebroder ebroder commented Jan 10, 2023

If Meteor triggers a page reload due to out-of-date code, stash the current state of whatever call we're in in sessionStorage, and use that to automatically re-join the call afterwards. We do some shenanigans to ensure that this only happens when Meteor triggers a page reload (as opposed to the user refreshing the page on their own).

Fixes #1314

This doesn't 100% work yet - it doesn't suppress allowInitialPeerStateNotification, so if you're muted and the page refreshes for a code push, you'll get the large call popup. It's also somewhat annoying to test in development mode, because hot-module-replacement completely prevents Meteor-drive page reloads. I temporarily ran meteor remove hot-module-replacement temporarily in my local copy for testing, although I think that completely stopping and restarting the Meteor server might also trigger a full-page refresh.

If Meteor triggers a page reload due to out-of-date code, stash the
current state of whatever call we're in in sessionStorage, and use that
to automatically re-join the call afterwards. We do some shenanigans to
ensure that this only happens when Meteor triggers a page reload (as
opposed to the user refreshing the page on their own).
@ebroder ebroder requested a review from zarvox January 10, 2023 19:06
@zarvox
Copy link
Contributor

zarvox commented Jan 10, 2023

One thing that I'm not totally sure about is if the goal of this is actually reliably achievable under certain browser-enforced policies about media capture and playback, particularly being able to obtain an AudioContext or microphone capture before any user interaction takes place in the document. In the case where the user has granted persistent microphone capture to the origin, I think we're probably fine. However, if the user granted a one-time permission grant (which I'll point out is Safari's default behavior, and that you have to poke around in the UI to find a way to grant permission persistently), I could totally believe that the user would get prompted or if there was no mouse or keyboard event on the page, that the getUserMedia request might be dropped entirely.

@zarvox
Copy link
Contributor

zarvox commented Jan 10, 2023

I suppose in those cases it's still probably a win for them to get re-prompted rather than just silently dropped from the call, but we might have to either temper our expectations or otherwise guide users toward enabling persistent audio access.

@ebroder ebroder closed this Jan 11, 2023
@ebroder
Copy link
Member Author

ebroder commented Jan 11, 2023

Closed in favor of #1329

@ebroder ebroder deleted the evan/rejoin-on-reload branch January 11, 2023 03:43
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.

Re-join call after code push causes a reload
2 participants