Skip to content

(bg-agents): observer catch robustness, folder-change upserts, writer typings (follow-up #887) #894

Open

Description

@devsuitup

Follow-up of #887 (#882), round-b review minors.

  1. The observer catch can still reject a write. session-index-writer.js ~20 reads error.message. An observer that throws null or undefined escapes the catch and rejects a committed command (measured on both paths). Use error?.message ?? String(error).
  2. An upsert that moves a session goes unnoticed. session-index-writer.js ~27 with bg-agents.js ~197: skipping upserts for entries already marked available assumes an upsert never moves a session to a folder without the file. One example is a remote-alias row taking over an id before the mirror has the file. In the recorder, send a folder change without upsertOnly.
  3. Types. session-index-writer.d.ts ~79 does not declare the log and onSessionsChanged options.
  4. One bad id loses the whole invalidation. bg-agents.js ~193: a non-string id makes id.toLowerCase() throw. Filter with typeof id === 'string'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions