Skip to content

Merge r2.8.7 with code 299 from develop to master#1174

Merged
jaymengxy merged 2 commits intomasterfrom
develop
Jun 10, 2025
Merged

Merge r2.8.7 with code 299 from develop to master#1174
jaymengxy merged 2 commits intomasterfrom
develop

Conversation

@jaymengxy
Copy link
Copy Markdown
Contributor

Related Issue

Closes #???

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@jaymengxy jaymengxy requested a review from a team as a code owner June 10, 2025 09:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 10, 2025

PR Summary

Fixed an issue where duplicate tokens could appear in the token list display by adding distinct filtering by contract ID. This ensures each token appears only once in the list, improving the user experience and data accuracy. Also bumped version code to 299.

Changes

File Summary
app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt Modified token list management to prevent duplicates by adding distinctBy { it.contractId() } when loading from cache, initial provider load, and list updates. This ensures unique tokens based on contract ID.
gradle.properties Incremented version code from 298 to 299 for release r2.8.7.

autogenerated by presubmit.ai

@jaymengxy jaymengxy merged commit 0b9bb62 into master Jun 10, 2025
5 checks passed
Copy link
Copy Markdown

@github-actions github-actions Bot 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 needs attention.

Review Summary

Commits Considered (2)
  • 2dd00eb: Merge pull request #1173 from onflow/fix_token_list

fix: duplicate token list

  • c82f77f: fix: duplicate token list
Files Processed (2)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt (3 hunks)
  • gradle.properties (1 hunk)
Actionable Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt [142-142]

    possible issue: "Potential null pointer issue in distinct operation"

Skipped Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt [178-178]

    performance: "Missing input validation for potentially large lists"

if (cachedList.displayTokenList.isNotEmpty()) {
currentDisplayTokenList.clear()
currentDisplayTokenList.addAll(cachedList.displayTokenList)
currentDisplayTokenList.addAll(cachedList.displayTokenList.distinctBy { it.contractId() })
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider handling potential null values returned by contractId(). If contractId() can return null, the distinctBy operation might not work as expected and could lead to unexpected behavior. You might want to add a null check or use distinctBy { it.contractId() ?: "" } to handle this case safely.

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