Logs in Service Worker #2379
Labels
App:Frontend
Kind:Core
Anything that changes or affects the fundamental core data structures & design of the application.
Kind:Enhancement
Improvements, new features, performance upgrades, etc.
Level:Advanced
Note:Contracts
Issues involving modifications to contracts
Priority:High
Problem
Currently, logs are captured using the
appLogs/startCapture
mechanism, which is used to save logs that users can submit for troubleshooting. This approach works well for the app currently, as the entirety of the app is running in the browsing context.However, this approach is not very well suited if parts of the app run in a different context, such as a service worker. The first issue is that each context has its own independent set of logs, and the second issue is keeping logs entries ordered. A third issue is handling logs for each tab in a resource-efficient manner (i.e., we wouldn't want to keep logs for each tab that was ever opened).
The issue related to ordering is that a proper 'true' order requires a global monotonic sequence so that entries from each context can be ordered. Unfortunately, no such thing exists that is performant. For example,
performance.now()
is not a global sequence (shared for an origin) andDate.now()
is not monotonic. However,Date.now()
is performant and simple, and behaves monotonically most of the time.Solution
Date.now()
so that most of the time we can order values, unless the clock is set backwards in time)The text was updated successfully, but these errors were encountered: