Skip to content

bug(feed-debug): soft reload restarts entry ids below the persisted cursor so persistence silently stops #770

Closed

Description

@Juliusolsson05

Symptom

After a soft reload of a session, feed-debug entries stop reaching disk until the ring's ids climb past the pre-reload cursor; nothing is logged.

Mechanism

src/renderer/src/workspace/hook/actions/session.ts (~142-186) replaces the runtime with emptyRuntime() fields, so feedDebugNextId restarts at 1, while refs.persistedFeedDebugIdRef (and main's process-local lastWrittenFeedDebugId in src/main/storage/feedDebugLog.ts) keep the old, larger cursor. selectFeedDebugAppendBatch filters entry.id > lastPersistedId, so every new entry is "already persisted" until the counter passes the old value; main would drop them for the same reason.

Expected

A reload must reset (or namespace) both cursors for that session — e.g. delete the renderer's persisted/in-flight cursor entries on reload and have main key lastWrittenFeedDebugId by an epoch carried in the batch — so the reloaded session's timeline is written from its first entry.

Evidence

Found during the review of #750 (pre-existing, identical before and after that PR).

Refs #748, #750, #722.

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