fix(ext/sw): inactivity timer resets on all non-passive messages (Plan C Phase 5)

DEV-C P2: an active autofiller never opens the popup, so under the old
rule it got force-locked despite continuous use. Inverts the rule:
reset on all messages except a documented exclusion set (only
get_autofill_candidates today).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-05-30 21:42:44 -04:00
parent 4a1c553f9d
commit ba5d218841
3 changed files with 46 additions and 2 deletions

View File

@@ -2,12 +2,12 @@
/// forwards every message into router/index.route().
import type { Request, Response, SessionTimeoutConfig } from '../shared/messages';
import { CONTENT_CALLABLE_TYPES } from '../shared/messages';
import type { RouterState } from './router/index';
import { route } from './router/index';
import * as vault from './vault';
import { clearCurrent } from './session';
import * as sessionTimer from './session-timer';
import { READ_ONLY_CONTENT_CALLABLE } from './session-timer';
// @ts-ignore TS2307 — resolved by webpack alias / copy
import initDefault, { initSync } from '../../wasm/relicario_wasm.js';
@@ -73,7 +73,10 @@ chrome.commands.onCommand.addListener((command) => {
chrome.runtime.onMessage.addListener(
(request: Request, sender: chrome.runtime.MessageSender, sendResponse: (r: Response) => void) => {
(async () => {
if (!CONTENT_CALLABLE_TYPES.has(request.type as never)) {
// Plan C Phase 5: invert the reset rule. Reset on every message
// except a documented passive-read exclusion set, so an active
// autofiller / content-driven flow keeps the vault alive.
if (!READ_ONLY_CONTENT_CALLABLE.has(request.type)) {
sessionTimer.resetTimer();
}
if (!state.wasm) {