Skip to content

[Act][Analysis] Data Inconsistency Risk: DB vs TSV Sync in Add Act #22

@vibhatha

Description

@vibhatha
except Exception as e:
            print(f"Failed to append to TSV: {e}", file=sys.stderr)
            # FIXME: Issue #22 (https://github.com/LDFLK/research/issues/22) - Potential data inconsistency between DB and TSV.
            # We don't rollback DB? 
            # Ideally we should, but for this "hacky" feature, DB is primary for UI, TSV is archival.
            pass

The comment "We don't rollback DB? Ideally we should, but for this 'hacky' feature, DB is primary for UI, TSV is archival." highlights a potential data inconsistency.

If the TSV write fails, the database will still contain the new act, but the archival TSV will be out of sync. This could lead to issues if the TSV is later used as a source of truth or for rebuilding the database.

Consider implementing a transaction to ensure atomicity (either both DB and TSV succeed or both fail) or at least a more robust error handling mechanism (e.g., retries, explicit rollback, or a clear warning to the user) to maintain data consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions