Skip to content

dealtracker: return result.Error, not shadowed outer err#671

Merged
parkan merged 2 commits intomainfrom
fix/dealtracker-wrong-err
Apr 24, 2026
Merged

dealtracker: return result.Error, not shadowed outer err#671
parkan merged 2 commits intomainfrom
fix/dealtracker-wrong-err

Conversation

@parkan
Copy link
Copy Markdown
Collaborator

@parkan parkan commented Apr 23, 2026

Summary

  • Two result.Error != nil checks after the market-deal ingest loop were returning the outer-scope err (nil on happy path, or a stale error from upstream) instead of result.Error.
  • On a failed UPDATE deals SET state=... the caller saw either misleading success or the wrong error.

Test plan

  • `go test ./service/dealtracker/...`
  • CI

Two back-to-back blocks after the market-deal ingestion mark deals as
expired / proposal-expired. Each checked result.Error but returned the
outer-scope err, which at that point holds whatever the upstream
streaming loop last set (nil on happy path).

On a failed UPDATE the caller saw either a misleading 'success' or a
stale error from an unrelated operation.
@parkan parkan requested a review from anjor April 23, 2026 19:05
@parkan parkan enabled auto-merge (squash) April 24, 2026 14:00
@parkan parkan merged commit b56574c into main Apr 24, 2026
1 check passed
@parkan parkan deleted the fix/dealtracker-wrong-err branch April 24, 2026 14:11
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.

2 participants