Skip to content

bug(feed-debug): the fail-closed unknown-file-size path resolves the append so the renderer marks unwritten entries durable #771

Description

@Juliusolsson05

Symptom

When stat of a session's feed-debug file fails for a reason other than ENOENT, the batch is dropped but the renderer advances its persisted cursor, so those entries are never resent and never written — while the comment claims the opposite.

Mechanism

src/main/storage/feedDebugLog.ts (~201-208): the "unknown on-disk size … fail CLOSED … return WITHOUT advancing the cursor so the renderer resends these entries" branch returns normally. The IPC handler (src/main/ipc/debug.ts, debug:append-feed-log) resolves, useFeedDebugPersist's .then sets persistedFeedDebugIdRef to the batch's max id, and the entries are marked durable.

Expected

That branch must reject (throw) so the renderer keeps the entries pending and retries after the pacing interval; the comment then becomes true. Add a test with a stat failure that is not ENOENT asserting the IPC rejects and a later batch re-includes the entries.

Evidence

Found during the review of #750 (pre-existing).

Refs #748, #750, #388.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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