Skip to content

fix: error handling for broken marks#2541

Open
valoq wants to merge 1 commit intogokcehan:masterfrom
valoq:marks
Open

fix: error handling for broken marks#2541
valoq wants to merge 1 commit intogokcehan:masterfrom
valoq:marks

Conversation

@valoq
Copy link
Copy Markdown
Contributor

@valoq valoq commented Apr 22, 2026

readMarks aborts with an error on the first line missing a colon and silently stops loading of every subsequent mark in the file. A single corrupt entry makes all later marks unreachable until the file is cleaned. readTags had the same bug pattern with the same consequences for the tags file.

@valoq valoq changed the title improve error handling for broken marks fix: error handling for broken marks Apr 22, 2026
Copy link
Copy Markdown
Collaborator

@CatsDeservePets CatsDeservePets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it still notify the user though? Otherwise they might never notice until manually enabling logs.

Copy link
Copy Markdown
Collaborator

@joelim-work joelim-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it still notify the user though? Otherwise they might never notice until manually enabling logs.

What happens is that when adding a new mark/tag, the corresponding file will be overwritten anyway according to whatever lf has stored in its internal state.

The current implementation aborts early and leaves lf with a blank state, and if the user adds a new mark/tag then the previous contents will be lost completely. So perhaps it is fine to silently log errors if it will be fixed the next time the file is saved anyway.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants