diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-05 23:25:53 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-05 23:25:53 +0300 |
| commit | 7f6fb4b7eae994972f883384de7feed4702c1c20 (patch) | |
| tree | 36b06cfdfaf1eeba8e1ff74899535e592dd04c74 | |
| parent | f784d30559569cba63d5d02aa3413346accea7fb (diff) | |
The interactive browser login/consent flow was bounded by a 1-minute
context timeout, too short for manual credential entry and 2FA,
causing "context deadline exceeded" errors. Bumped to 5 minutes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
| -rw-r--r-- | internal/platforms/linkedin/linkedin.go | 7 | ||||
| -rw-r--r-- | internal/version.go | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index ced242a..a9a6fef 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -22,6 +22,11 @@ var errUnauthorized = errors.New("unauthorized access, refresh or create token?" const linkedInTimeout = 10 * time.Second +// linkedInAuthTimeout bounds the interactive browser login/consent flow when +// (re-)authenticating, so it needs to be generous enough for manual entry of +// credentials and 2FA rather than a normal API call timeout. +const linkedInAuthTimeout = 5 * time.Minute + // addCommonHeaders applies required headers and optional LinkedIn versioning. func addCommonHeaders(req *http.Request, accessToken, liVersion string) { req.Header.Set("Authorization", "Bearer "+accessToken) @@ -51,7 +56,7 @@ func post(ctx context.Context, args config.Args, sizeLimit int, en entry.Entry) timeout := linkedInTimeout if args.Config.LinkedInAccessToken == "" { // Refreshing access token requires more time due to human interaction - timeout = 1 * time.Minute + timeout = linkedInAuthTimeout } newCtx, cancel := context.WithTimeout(ctx, timeout) defer cancel() diff --git a/internal/version.go b/internal/version.go index 5e688a8..75206e1 100644 --- a/internal/version.go +++ b/internal/version.go @@ -6,7 +6,7 @@ import ( "codeberg.org/snonux/gos/internal/table" ) -const versionStr = "v1.3.0" +const versionStr = "v1.3.1" func printVersion() { table.New(). |
