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: register listeners sync #2350

Merged
merged 1 commit into from
Apr 16, 2023
Merged

fix: register listeners sync #2350

merged 1 commit into from
Apr 16, 2023

Conversation

reneaaron
Copy link
Contributor

@reneaaron reneaaron commented Apr 13, 2023

Describe the changes you have made in this PR

Possibly fixes #2305 🤞

MV3 Migration Guide

@github-actions
Copy link

🚀 Thanks for the pull request!

Here are the current build files for testing:

Download and unzip the file for your browser. Refer to the readme for detailed install instructions.


This build is brought to you by: channel.ninja (who recently dropped 1000 sats):


Want to sponsor the next build? send some sats to ⚡️builds@getalby.com (don't forget to provide your name)

Don't forget: keep earning sats!

@rolznz
Copy link
Contributor

rolznz commented Apr 14, 2023

@reneaaron nice! I think this fixes this particular issue. I am just worried about what will happen if we receive requests while the init() function is still running, which might introduce strange errors. I still think it would be good to wait for the service worker / background script to finish the init() before we start interacting with it.

CC @bumi

@reneaaron
Copy link
Contributor Author

I am just worried about what will happen if we receive requests while the init() function is still running, which might introduce strange errors. I still think it would be good to wait for the service worker / background script to finish the init() before we start interacting with it.

What would we do with messages that are sent before init() finished then? Drop them? Couldn't that lead to other problems? (promises not being resolved, etc?)

@rolznz
Copy link
Contributor

rolznz commented Apr 16, 2023

I am just worried about what will happen if we receive requests while the init() function is still running, which might introduce strange errors. I still think it would be good to wait for the service worker / background script to finish the init() before we start interacting with it.

What would we do with messages that are sent before init() finished then? Drop them? Couldn't that lead to other problems? (promises not being resolved, etc?)

@reneaaron this fixes the issue for me and was just raising the possibility of other issues, but I can't produce them. I think we should merge this 🚀

@reneaaron reneaaron marked this pull request as ready for review April 16, 2023 13:10
@bumi
Copy link
Collaborator

bumi commented Apr 16, 2023

I don't think it is possible to easily handle messages sent before the init is done.

@reneaaron reneaaron merged commit dc61728 into master Apr 16, 2023
@reneaaron reneaaron deleted the fix/register-listeners-sync branch April 16, 2023 15:35
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.

[BUG] An unexpected error occurred (Could not establish connection. Receiving end does not exist)
3 participants