fix: error handling for broken marks#2541
Open
valoq wants to merge 1 commit intogokcehan:masterfrom
Open
Conversation
Collaborator
CatsDeservePets
left a comment
There was a problem hiding this comment.
Shouldn't it still notify the user though? Otherwise they might never notice until manually enabling logs.
joelim-work
reviewed
Apr 23, 2026
Collaborator
joelim-work
left a comment
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.