Comments (2)
I think storing with the trace makes sense and probably gets us what we need in order to discard stale messages in handlers.
Given that all the messengers are running on the same PC, we could potentially use timestamps instead? (And any given sender could wait a clock tick if needed to in order to ensure it's not sending any duplicate timestamps)
I'm not sure what time resolution browser extensions get?: https://developer.mozilla.org/en-US/docs/Web/API/Performance/now. Looks like maybe millisecond but that the browser might intentionally jitter it? I'd hope it would at least be monotonically increasing in the same thread
If we were writing a distributed system, we'd use some prior are for event ordering, e.g., https://en.wikipedia.org/wiki/Lamport_timestamp and https://en.wikipedia.org/wiki/Vector_clock. But we should need that given that there's a single source of truth for time?
from webext-messenger.
Yeah a timestamp would be good and it would be extremely easy to implement. I assume that the browser never returns 2 timestamps out of order, which is what matters here anyway, we're not tracking nanosecond-level performance.
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.