Comments (5)
Currently the application has to be careful not to import the messenger receiver until the rest of the setup has occurred.
That will be fixed for #74, which will make the messenger ignore communication until the first registerMethods
call. The messenger will be “ready” when we call registerMethods
, which we do once per context.
Having a secondary setMessengerReady()
function means we still need to make sure to not add further registerMethods
calls after that, so it has a similar risk. Given that we only have one messenger/methods.ts
file per context, it’s not a problem at the moment.
from webext-messenger.
That will be fixed for #74, which will make the messenger ignore communication until the first registerMethods call.
IIRC, registerMethods is called by the initInternalApi. So this is implying that the initInternalApi call won't call registerMethods anymore?
Having a secondary setMessengerReady() function means we still need to make sure to not add further registerMethods calls after that, so it has a similar risk. Given that we only have one messenger/methods.ts file per context, it’s not a problem at the moment.
I'm OK to proceed either way. In both cases, I think the would be a warning to designate mis-use
- Warn if registerMethods is called multiple times
- Warn if registerMethods is called after setMessengerReady (if we choose to add that method)
What's an ETA on a fix? I'm planning the PixieBrix 1.7.5 release schedule
from webext-messenger.
Since you merged pixiebrix/pixiebrix-extension#4061, this is no longer a blocking issue. I will likely finish it tomorrow. Parcel (tests) are giving me grief so I had to take a break.
from webext-messenger.
this is no longer a blocking issue
It solves the case where it fails 100% of the time, but doesn't completely solve the problem (one user had actually been seeing the bug, or a related bug, reliably pre-1.7.4).
We've already deployed workarounds for our enterprise customers, so will look to get the real fix into the 1.7.5 release
from webext-messenger.
But I think this wouldn't fix what you're describing. We already have exactly one registerMethod call per context, which currently happens before any init function except for the content script (and that has been fixed by your recent PR).
Even if the private call happens long before registerMessenger
, it still happens in the same tick, there is no chance that a message is received between a webext-messenger
import and registerMessenger
call currently. That's why this change is only to future-proof it rather than fixing current bugs.
from webext-messenger.
Related Issues (20)
- Remove branch protection from repo HOT 1
- Handle repeated injection gracefully HOT 6
- Drop `webextensions-polyfill` to avoid unnecessary abstraction
- Toggle WEBEXT_LOGGING at runtime
- Dispatch retries event and retry-exhaustion event
- Do not retry discarded tabs, return specific error
- Use `browser.runtime.getFrameId()` HOT 1
- Update Parcel
- Track timing HOT 2
- Immediately handle context invalidation, disabling further messaging
- Accept `Promise<Target>`
- Support `allFrames` as target
- Ensure sequence numbers are never reused HOT 2
- Error: Tabs cannot be edited right now (user may be dragging a tab).
- `retry: false` not respected when forwarding
- Add `extractTargetFromSender`
- Unwanted forwarding when targeting `allFrames` HOT 2
- Fail when trace.length > 2 HOT 2
- Meta: update parcel to 2.12+
- Preserve seq number when forwarding
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webext-messenger.