Skip to content

Commit 5ec67b6

Browse files
committed
chore: update journeys with rich format
1 parent e256a08 commit 5ec67b6

4 files changed

Lines changed: 24 additions & 16 deletions

File tree

journeys/cjit-notifications/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ producers:
2222

2323
## The fix (what the journeys assert)
2424

25-
- `WakeNodeWorker` formats amounts with `formatToModernDisplay()` (space-grouped). [#1]
26-
- `WakeNodeWorker` only emits the "Via new channel" CJIT notification when the channel actually has
27-
a Blocktank CJIT entry; a regular channel opening shows no payment notification. [#3]
25+
- All received-payment notifications (foreground service, in-app, and the `WakeNodeWorker` push
26+
path, for both regular payments and CJIT receives) are built by one shared
27+
`ReceivedNotificationContent`, so they are identical: title "Payment Received", body
28+
"Received ₿ <amount> (<fiat>)" — space-grouped BTC plus fiat, ordered by the primary
29+
display setting (or hidden when notification details are off). The legacy bare "₿ <sats>" /
30+
"Via new channel" push format is gone. [#1]
31+
- `WakeNodeWorker` only emits a CJIT notification when the channel actually has a Blocktank CJIT
32+
entry and the receive was not already recorded; a regular channel opening shows no payment
33+
notification. [#3]
2834
- `WakeNodeWorker` skips its own user-facing notification when an in-process handler covers the
2935
event — i.e. when the app is in the foreground OR `LightningNodeService.isRunning` — leaving a
30-
single, richer notification. It still wakes the node and records the activity. [#2]
36+
single notification. It still wakes the node and records the activity. [#2]
3137

3238
## Mandatory setup
3339

@@ -54,6 +60,9 @@ notifications Bitkit posted for a single channel opening.
5460
## Test tags / references
5561

5662
- Foreground "Spending balance ready" toast: testTag `SpendingBalanceReadyToast`.
57-
- Notification strings: `notification__received__title`, `notification__received__body_channel`
58-
("Via new channel"), `notification__received__body_amount` ("Received %s").
59-
- Amount grouping separator: `SATS_GROUPING_SEPARATOR` (a space) via `formatToModernDisplay`.
63+
- Notification strings: `notification__received__title` ("Payment Received"),
64+
`notification__received__body_amount` ("Received %s"), `notification__received__body_hidden`
65+
(when notification details are off). Note: `notification__received__body_channel`
66+
("Via new channel") is no longer used for the push notification.
67+
- Amount grouping separator: `SATS_GROUPING_SEPARATOR` (a space) via `formatToModernDisplay`,
68+
applied inside `ReceivedNotificationContent`.

journeys/cjit-notifications/cjit-foreground-service-notification.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<action>Wait ~5s for the ChannelReady event and notification delivery</action>
1919
<action>Dump notifications: adb shell dumpsys notification --noredact | grep -A3 -i "to.bitkit"</action>
2020
<action>Verify EXACTLY ONE Bitkit payment notification is posted for this channel opening (not two)</action>
21-
<action>Verify its amount uses a thousands separator space, e.g. "₿ 48 064" — NOT "₿ 48064"</action>
22-
<action>Verify there is NO separate notification whose body is "Via new channel" alongside the payment notification</action>
21+
<action>Verify its title is "Payment Received" and body is "Received ₿ &lt;amount&gt; (&lt;fiat&gt;)" with the amount space-grouped (e.g. "Received ₿ 48 064 ($30.79)") — NOT a bare "₿ 48064"</action>
22+
<action>Verify there is NO separate "Via new channel" notification from WakeNodeWorker alongside it (the push path is deduped while the foreground service is running)</action>
2323
<action>Tap the notification, bring the app to the foreground, and verify the received-transaction sheet shows the correct amount</action>
2424
</actions>
2525
</journey>

journeys/cjit-notifications/cjit-push-single-notification.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
Reproduces PR #787 issue #2 on the pure push path. With the app fully killed (no foreground
44
activity and no foreground service), a CJIT payment must still surface a single payment
55
notification delivered by WakeNodeWorker — this is the wake-the-node-and-open-the-channel path,
6-
so it must keep working. The amount must be space-grouped.
6+
so it must keep working. The notification must use the same rich content as the in-app one:
7+
title "Payment Received", body "Received ₿ &lt;amount&gt; (&lt;fiat&gt;)" — NOT the old bare
8+
"₿ &lt;sats&gt;" / "Via new channel".
79

810
Precondition: onboarded regtest wallet connected to the LSP. A funded CJIT entry is ready to pay
911
(see README.md). Background notifications DISABLED (so no foreground service survives the kill),
@@ -16,8 +18,7 @@
1618
<action>Wait up to ~30s for the FCM push to wake the node and deliver the notification</action>
1719
<action>Dump notifications: adb shell dumpsys notification --noredact | grep -A3 -i "to.bitkit"</action>
1820
<action>Verify EXACTLY ONE Bitkit notification is posted for this CJIT payment</action>
19-
<action>Verify the amount is space-grouped, e.g. "₿ 48 064" — NOT "₿ 48064"</action>
20-
<action>Verify the notification body is "Via new channel"</action>
21+
<action>Verify the title is "Payment Received" and the body is "Received ₿ &lt;amount&gt; (&lt;fiat&gt;)" with the amount space-grouped (e.g. "Received ₿ 48 064 ($30.79)") — NOT a bare "₿ 48064" and NOT "Via new channel"</action>
2122
<action>Tap the notification to open the app and verify the received amount in the activity list matches</action>
2223
</actions>
2324
</journey>

journeys/cjit-notifications/non-cjit-channel-no-payment-notification.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<journey name="non-cjit channel opening shows no payment notification">
22
<description>
33
Reproduces PR #787 issue #3 (🔴). Opening a regular (non-CJIT) Lightning channel must NOT be
4-
reported as a received payment: no "₿ &lt;amount&gt; / Via new channel" notification, and never
5-
several duplicates. When the app is in the foreground the only feedback is the in-app "Spending
6-
balance ready" toast.
4+
reported as a received payment: no "Payment Received" notification, and never several duplicates.
5+
When the app is in the foreground the only feedback is the in-app "Spending balance ready" toast.
76

87
Precondition: onboarded regtest wallet connected to the LSP, with a positive on-chain balance to
98
fund the transfer. No CJIT entry is involved here — this is a manual/Transfer channel opening
@@ -16,7 +15,6 @@
1615
<action>Wait for the ChannelReady event (~5-10s)</action>
1716
<action>Verify an in-app "Spending balance ready" toast appears (testTag "SpendingBalanceReadyToast")</action>
1817
<action>Dump notifications: adb shell dumpsys notification --noredact | grep -A3 -i "to.bitkit"</action>
19-
<action>Verify NO Bitkit notification with body "Via new channel" was posted</action>
2018
<action>Verify NO "Payment Received" notification was posted for this channel opening</action>
2119
<action>Verify there are not multiple duplicate channel-ready notifications stacked in the shade</action>
2220
</actions>

0 commit comments

Comments
 (0)