Skip to content

feat(chatarchive): add file locking for concurrent manifest writes #85

@CodeMonkeyCybersecurity

Description

Problem

If two eos backup chats invocations run simultaneously, both could read the same manifest and race on write, leading to data loss in the manifest.

Root Cause

No file locking on manifest.json during read-modify-write cycle in pkg/chatarchive/archive.go.

Proposed Fix

Use flock() (Unix) or LockFileEx (Windows) on the manifest file during the write phase. Go's golang.org/x/sys package provides cross-platform file locking.

Priority

P2 — low probability for a local CLI tool, but worth fixing for robustness.

Refs: pkg/chatarchive/archive.go, pkg/chatarchive/manifest.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions