aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-resolve.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-15 23:57:14 -0500
committerCraig Jennings <c@cjennings.net>2026-06-15 23:57:14 -0500
commit546bcf9bbe651eaaa0129346536c9e7e98748555 (patch)
treef152accb4bf9559c78d388665fed7738494783bb /tests/test-pearl-resolve.el
parente749badfd974de42fe8d7cdbe2bfa4fa3e0771b2 (diff)
downloadpearl-546bcf9bbe651eaaa0129346536c9e7e98748555.tar.gz
pearl-546bcf9bbe651eaaa0129346536c9e7e98748555.zip
fix(api): clear auth-source's negative cache on pearl-clear-cache
A key added to authinfo read as missing for up to 2h because auth-source caches the negative lookup and `pearl-clear-cache` only cleared pearl's own caches. It now also calls `auth-source-forget-all-cached`, and the auth-source miss tells the user to run `M-x pearl-clear-cache`. This is the 2026-06-01 live incident, where a freshly-synced Linear key kept erroring as unset.
Diffstat (limited to 'tests/test-pearl-resolve.el')
-rw-r--r--tests/test-pearl-resolve.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test-pearl-resolve.el b/tests/test-pearl-resolve.el
index aefe27a..df75b6f 100644
--- a/tests/test-pearl-resolve.el
+++ b/tests/test-pearl-resolve.el
@@ -136,6 +136,15 @@
(should-not pearl--cache-states)
(should-not pearl--cache-teams)))
+(ert-deftest test-pearl-clear-cache-forgets-auth-source ()
+ "Clearing the cache also drops auth-source's own cache, so a key just added
+to authinfo is findable without waiting out the 2h auth-source TTL."
+ (let ((called nil))
+ (cl-letf (((symbol-function 'auth-source-forget-all-cached)
+ (lambda (&rest _) (setq called t))))
+ (pearl-clear-cache)
+ (should called))))
+
;;; failure / malformed cases
(ert-deftest test-pearl-team-collection-malformed-returns-nil-no-cache ()