From ee6c3f723be8b14048864b0b49afe9324b072b97 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 10 Mar 2026 11:19:33 -0400 Subject: [PATCH] fix(sync): add backend name prefix to all OAuth log messages (#121) Problem: four log messages in `oauth.lua` lacked the `self.name` backend prefix, producing generic notifications instead of identifying which backend (`gcal`/`gtasks`) triggered the message. Solution: prepend `self.name .. ': '` to the four unprefixed messages and drop the hardcoded "Google" from the browser prompt since `self.name` already identifies the service. --- lua/pending/sync/oauth.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/pending/sync/oauth.lua b/lua/pending/sync/oauth.lua index 516a353..9d8491f 100644 --- a/lua/pending/sync/oauth.lua +++ b/lua/pending/sync/oauth.lua @@ -447,12 +447,12 @@ function OAuthClient:auth(on_complete) end) vim.ui.open(auth_url) - log.info('Opening browser for Google authorization...') + log.info(self.name .. ': Opening browser for authorization...') vim.defer_fn(function() if not server_closed then close_server() - log.warn('OAuth callback timed out (120s).') + log.warn(self.name .. ': OAuth callback timed out (120s).') end end, 120000) end @@ -490,14 +490,14 @@ function OAuthClient:_exchange_code(creds, code, code_verifier, port, on_complet if result.code ~= 0 then self:clear_tokens() - log.error('Token exchange failed.') + log.error(self.name .. ': Token exchange failed.') return end local ok, decoded = pcall(vim.json.decode, result.stdout or '') if not ok or not decoded.access_token then self:clear_tokens() - log.error('Invalid token response.') + log.error(self.name .. ': Invalid token response.') return end