Skip to content

Conversation

@onyb
Copy link
Member

@onyb onyb commented Jan 9, 2026

Fixes GATE3-20 on Sentry

@onyb onyb requested a review from a team January 9, 2026 20:30
@onyb onyb self-assigned this Jan 9, 2026
Copilot AI review requested due to automatic review settings January 9, 2026 20:30
@onyb onyb force-pushed the h/swap/fix-chain-equality branch from 45d3e42 to 059389e Compare January 9, 2026 20:31
@onyb onyb changed the title fix(swap): fix equality check for Chain objects with None fix(common): fix equality check for Chain objects with None Jan 9, 2026
@onyb onyb enabled auto-merge (squash) January 9, 2026 20:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where comparing Chain enum objects with None would cause an error (GATE3-20 on Sentry). The fix adds proper type checking in the Chain.eq method to safely handle comparisons with None and other non-Chain objects.

Key changes:

  • Updated Chain.eq to check if the other object is None or not a Chain instance before comparing attributes
  • Added comprehensive test coverage for Chain equality edge cases
  • Version bumped to 0.11.1

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Version bump from 0.11.0 to 0.11.1 for the bug fix release
app/api/common/models.py Fixed Chain.eq to handle None and non-Chain object comparisons safely
app/api/common/test_models.py Added comprehensive tests for Chain equality including None, invalid types, and valid chain comparisons
app/api/swap/providers/jupiter/client.py Code formatting improvement (split long line)
app/api/oauth/zebpay.py Import reordering to follow PEP 8 conventions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

none = None
assert (none == chain) is False

assert chain == chain
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Comparison of identical values; use cmath.isnan() if testing for not-a-number.

Suggested change
assert chain == chain

Copilot uses AI. Check for mistakes.
assert (none == chain) is False

assert chain == chain
assert chain is chain
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Comparison of identical values; use cmath.isnan() if testing for not-a-number.

Suggested change
assert chain is chain
assert isinstance(chain, Chain)

Copilot uses AI. Check for mistakes.
@sentry
Copy link

sentry bot commented Jan 9, 2026

Sentry Issue: GATE3-20

@onyb onyb added the bug Something isn't working label Jan 9, 2026
@onyb onyb merged commit 97611b4 into master Jan 9, 2026
5 checks passed
@onyb onyb deleted the h/swap/fix-chain-equality branch January 9, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants