fix: review findings for lazysecrets list: recent means the last 90 days, cache saves lock and keep deletions and the TUI's cursors, failed lists aren't retried, one expiry rule
This commit is contained in:
23 files changed
+333
-107
No files matched your search
@@ -67,10 +67,23 @@ func (m *Model) refreshShown(before []provider.Object) tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
m.detail.Refresh(s)
|
||||
delete(m.cache.details, detailKey(s))
|
||||
uncache(m, m.cache.details, detailKey(s))
|
||||
return m.describe(s)
|
||||
}
|
||||
|
||||
// uncache deletes key from a cache, and, at the next save, from the file.
|
||||
func uncache[T any](m *Model, c map[string]entry[T], key string) {
|
||||
if _, ok := c[key]; !ok {
|
||||
return
|
||||
}
|
||||
delete(c, key)
|
||||
if m.cacheDropped == nil {
|
||||
m.cacheDropped = map[string]bool{}
|
||||
}
|
||||
m.cacheDropped[key] = true
|
||||
m.cacheDirty = true
|
||||
}
|
||||
|
||||
// sameListing reports whether a and b list the same: what a list
|
||||
// says of an object, not what describing it adds.
|
||||
func sameListing(a, b provider.Object) bool {
|
||||
|
||||
Reference in new issue
Block a user