fix(wallet): count all incoming money toward the "Add Money" milestone - #1279
Merged
Merged
Conversation
The onboarding milestone only looked for a completed deposit or on-ramp buy, so a user who had been tipped — money that plainly arrived — was still shown "Add Money" as an outstanding step, and the wallet's action tiles stayed hidden. Widen the criteria to every completed *incoming* feed entry: a buy, a deposit, or a tip received. That is exactly the credit side of the feed (MessageMetadata.isOutgoing == false). Swaps stay excluded — they debit the source mint rather than bringing new money in. Renames the plumbing (hasEverAddedMoney -> hasEverReceivedMoney, State .hasAddedMoney -> .hasReceivedMoney) to match what it now measures; the TutorialItem.AddMoney label is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The new-user tutorial's Add Money milestone only looked for a completed deposit or on-ramp buy:
So a user whose money arrived as a tip still saw "Add Money" as an outstanding step — and, because the same flag gates the wallet's 2x2 action grid, those tiles stayed hidden too.
Fix
Widen the criteria to every completed incoming feed entry — a buy, a deposit, or a tip received (
ReceivedCrypto). That set is exactly the credit side of the feed, i.e.MessageMetadata.isOutgoing == false.Swaps stay excluded: a swap debits the source mint rather than bringing new money in, consistent with how
isOutgoingalready classifies them.The plumbing is renamed to match what it now measures —
hasEverAddedMoneytohasEverReceivedMoney,State.hasAddedMoneytoState.hasReceivedMoney. The user-facingTutorialItem.AddMoneylabel is unchanged.Tests
New
MessageDaoTest(Robolectric + in-memory Room), 7 cases covering the milestone:PENDINGreturns false:apps:flipcash:features:balance,:apps:flipcash:shared:transaction-history, and:apps:flipcash:shared:persistence:sourcesunit tests pass.