Skip to content

ADR-004: The worker keeps no state

Status: Accepted

Decision: The service worker must not keep state between messages.

Why: Chrome stops an MV3 service worker after approximately 30 seconds without activity. Each new event starts the timer again. The worker writes its state to browser.storage.session and reads it again for each message, so each operation can safely happen again.

Read the architecture and the service worker.