Skip to content

fix(api): centralize requests and correct tracking headers #14 - #17

Merged
yashiels merged 1 commit into
mainfrom
agent/request-boundary
Oct 14, 2026
Merged

yashiels merged 1 commit into
mainfrom
agent/request-boundary

Conversation

@yashiels

Copy link
Copy Markdown
Owner

Closes #14

M1 of #13. Centralizes all authenticated LinkedIn send paths, rejects redirects with default and injected clients, corrects duplicate tracking JSON fields and keeps mutations single-shot. No native Android identity claim; existing legacy header version remains intentionally unchanged.

Verification on ac29d75:

  • Independent make ci, make lint and build passed on macOS.
  • Actual .github/workflows/ci.yml test job passed through act on Linux amd64, Go 1.26.4. Exported source matched the pinned Git tree before and after execution.
  • Oracle implementation SIGNED OFF in round 2 after supplying missing construction-call evidence. No code changed between review rounds.
  • Worker commit GPG signature verified. Behavioral regression tests failed before the fix and pass with it.
  • No live LinkedIn/account requests or credential changes.

Dependent M2 #15 adds durable pacing, quota and refusal state. This PR intentionally retains existing read retry behavior until M2. M3 #16 documents final behavior and release compatibility.

Local act warnings: exported tree has no Git metadata and setup-go skipped cache save. All actual vet, race tests and formatting steps passed.

@sentinel-skyner sentinel-skyner Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Sentinel review

1 material regression found in redirect auth handling.

1 inline comment below.

Automated review via cursorbridge:gpt-5.3-codex. Findings only — not an approval. Push new commits to re-review.

Comment thread internal/api/request.go
cancel()
var timed net.Error
if errors.As(err, &timed) && timed.Timeout() {
return nil, types.NetworkError("LinkedIn request timed out", context.DeadlineExceeded)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Medium Only login/authwall-style redirect targets are classified as auth expiry. A 302 redirect back to the same Voyager URL (a known expired-session pattern) is treated as a generic network redirect error, so callers miss the re-auth path and surface the wrong failure mode.

Suggested change
return nil, types.NetworkError("LinkedIn request timed out", context.DeadlineExceeded)
if loc := resp.Header.Get("Location"); authRedirect(u, loc) || loc == u.RequestURI() || loc == u.String() {

@yashiels
yashiels merged commit 6f23f12 into main Oct 14, 2026
1 check passed
@yashiels
yashiels deleted the agent/request-boundary branch October 14, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralize LinkedIn requests and correct legacy tracking headers

1 participant