When a Keep-specific service account file (keep-sa-*.json) exists,
tokenSourceForServiceAccountScopes falls back to it for all API calls,
not just Keep. This causes 401 errors on Calendar, Gmail, Drive, and
other services that should use OAuth.
Only use keep-sa and legacy Keep SA files when serviceLabel is "keep",
allowing other services to fall through to OAuth authentication.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(drive): include shortcutDetails in drive get fields
Add shortcutDetails to the Drive Get API fields to enable resolving
shortcut target file IDs and MIME types.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(googleapi): replace Client.Timeout with transport-level ResponseHeaderTimeout
The global http.Client.Timeout (30s) applied to the entire request
lifecycle, causing large Drive file downloads (videos, backups, etc.)
to time out. Replace it with http.Transport.ResponseHeaderTimeout
which only limits the time waiting for the server to begin responding.
Once response headers arrive and the body starts streaming, there is
no hard cap — large transfers complete naturally.
- Set ResponseHeaderTimeout=30s on the base transport
- Remove http.Client.Timeout from the API client
- Keep a dedicated tokenExchangeTimeout=30s for OAuth2 token refreshes
- Add tests verifying the new transport configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Ensure gmail watch serve re-applies the selected OAuth client to request-time contexts before creating Gmail services, so push handling does not fall back to client default in multi-client setups.
* fix(gmail): allow workspace native aliases for --from
* fix: land Workspace alias send fix and changelog (#407) (thanks @salmonumbrella)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(gmail-watch): delay history fetch in watch serve
* fix: land gmail watch fetch delay and changelog (#397) (thanks @salmonumbrella)
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
- Import time/tzdata in cmd/gog/main.go to bundle the IANA tz database
into the binary (~450KB), fixing time.LoadLocation on Windows
- Add tzdata_test.go verifying LoadLocation works for representative zones
- Add windows-latest CI job running the full gate (fmt, lint, test, build)
* fix(contacts): correct parameter types in contacts apply helpers
Go's parameter grouping syntax caused `given` and `org` to be typed as
`bool` instead of `string` in contactsApplyPersonName and
contactsApplyPersonOrganization, resulting in a build failure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(contacts): resolve lint errors from upstream refactor
- Rewrite if-else chain to switch statement (gocritic)
- Rename `clear` variable to `clearAll` to avoid shadowing predeclared
identifier (predeclared)
- Remove unused `primaryURL` function (unused)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Add `gog sheets links` (alias: hyperlinks) command that retrieves
hyperlinks embedded in cells via spreadsheets.get with IncludeGridData.
Mirrors the existing `notes` command pattern using the CellData.Hyperlink field.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
--to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
--to now does NOT expand to end-of-day (remains current time)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add boolTrue/boolFalse constants for string "true"/"false" values
- Rename shadowed err variable to writeErr in test file
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add integration tests verifying isDayExpr() integration:
- TestResolveTimeRangeWithDefaultsToTomorrowEndOfDay: verifies
--to tomorrow expands to end-of-day (23:59:59.999999999)
- TestResolveTimeRangeWithDefaultsToNowNoExpansion: verifies
--to now does NOT expand to end-of-day (remains current time)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Distinguish the update command from write by specifying it inserts
text at a specific index position in the document.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test that --index flag properly rejects zero and negative values
with the expected error message.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cover the readTextInput function and file path expansion logic
by testing DocsWriteCmd and DocsUpdateCmd with temp files.
Also test error cases: non-existent file, empty file, and
mutual exclusion of --text and --file flags.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>