Skip to content

last_date_uploaded is state, not configuration should not live in ~/.splitrail.toml #175

@mcowger

Description

@mcowger

UploadConfig in src/config.rs contains a last_date_uploaded: i64 field that gets persisted to ~/.splitrail.toml alongside genuine user configuration like api_token, auto_upload, and formatting preferences.

[upload]
auto_upload = true
upload_today_only = false
retry_attempts = 3
last_date_uploaded = 1780504895267  # <-- this doesn't belong here

This value is runtime state — it is never set by the user and changes automatically as a side effect of uploading. Keeping it in the config file creates a problem for anyone who version-controls their dotfiles: every upload causes a dirty diff in what should be a stable, user-managed file.

A cleaner approach would be a separate state file, e.g. ~/.local/share/splitrail/state.toml on Linux (following the XDG spec), or a platform-appropriate equivalent via the dirs crate (which is already a dependency). The config file would then contain only values a user would deliberately set.

If the maintainers are open to this, I'm happy to implement the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions