Skip to content

Track token-loaded state more explicitly #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2025

Conversation

swansontec
Copy link
Contributor

@swansontec swansontec commented Jul 16, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@swansontec swansontec force-pushed the william/fix-token-loading branch from dae8857 to 6a3e63b Compare July 17, 2025 17:53
@swansontec swansontec force-pushed the william/fix-token-loading branch from 6a3e63b to b553d95 Compare July 18, 2025 00:23
@swansontec swansontec enabled auto-merge July 18, 2025 00:24
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Incorrect Token Removal Detection

The onNewTokens callback incorrectly logs "removed" tokens. The removed variable is calculated as whatsNew(detectedTokenIds, tokenIds). Since tokenIds represents only the newly detected tokens from the current callback invocation, and detectedTokenIds represents all currently detected tokens, this calculation incorrectly identifies existing detected tokens (those not in the current new batch) as "removed." This is misleading as onNewTokens is an add-only callback, and no tokens are actually removed from the wallet's detected list. The variable name removed is therefore inaccurate and confusing.

src/core/currency/wallet/currency-wallet-callbacks.ts#L142-L147

// Logging:
const added = whatsNew(tokenIds, detectedTokenIds)
const removed = whatsNew(detectedTokenIds, tokenIds)
const shortId = walletId.slice(0, 2)
input.props.log.warn(
`enabledTokenIds: ${shortId} engine detected tokens, add [${added}], remove [${removed}]`

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@swansontec swansontec merged commit 5246128 into master Jul 18, 2025
3 checks passed
@swansontec swansontec deleted the william/fix-token-loading branch July 18, 2025 00:32
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