Conversation
fix: duplicate token list
PR SummaryFixed 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
autogenerated by presubmit.ai |
There was a problem hiding this comment.
🚨 Pull request needs attention.
Review Summary
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() }) |
There was a problem hiding this comment.
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.
Related Issue
Closes #???
Summary of Changes
Need Regression Testing
Risk Assessment
Additional Notes
Screenshots (if applicable)