You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sweep: note.daily computes the daily-note path before it takes the vault's lock, but lodge-app.md says it is judged under the lock #250
note.daily and note.appendDaily: the day's note writable, or under daily today's, and not under except. It is judged under the vault's lock, at the path the daily-note settings give.
line 73 reads the settings (LoadSettings(v.root)) and line 77 computes the path (DailyPath(settings.Daily, date)) before line 86 takes the lock (v.lock());
line 93 then judges that path (checkGuard(ctx, p)), under the lock.
internal/vault/configure.go line 31: Configure writes the settings under the same lock, so it can change the daily-note folder or format between lines 77 and 86.
api/scope.go line 330, CheckDaily, allows a daily token to write p when today is true, whatever p is.
Why it matters: A token limited to today's daily note can, in that window, write the note at the old daily path, which is no longer the daily note and can be outside the token's scope. The spec says the path is taken under the lock to close this.
Suggested fix: Read the settings and compute the path after v.lock(), and add a test that changes the settings between the two steps (or a test that holds the order).
Activity
fix: the sweep issues #250, #251, #252 and #253 (#259)