Page MenuHomePhabricator

[Cashtab] [Chronik Websocket Notifications] [Part 7] Display XEC notifications from ws msg
ClosedPublic

Authored by bytesofman on May 30 2022, 18:38.

Details

Summary

T2447

Depends on D11537

Display notification when websocket picks up an incoming XEC tx

NB: As this is part of a stacked diff, it is expected behavior for the app to notify twice for incoming XEC tx. This will be corrected in a later diff on this stack.

Test Plan

npm start
Send yourself an XEC tx
Note a tx that reads "eCash Received" -- this is from the ws
Change wallets and repeat

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested changes to this revision.Jun 1 2022, 04:10
emack added a subscriber: emack.

Since D11537 broke the stacking sequence, this subsequent diff also do not have the stacked content from D11536 and earlier.

This revision now requires changes to proceed.Jun 1 2022, 04:10

OK -- corrected, let me know if still won't come down.

The websocket notification is not displaying the fiat price for the incoming tx.

image.png (131×648 px, 10 KB)

The fiatPrice param is null when passed into xecReceivedNotificationWebsocket from processChronikWsMsg

which is strange at first glance because initializeFiatPriceApi is executed on page load, which should have then called fetchBchPrice, which sets the price via setFiatPrice.

This isn't a stub approach where you're planning a subsequent diff for the fiat price?

The websocket notification is not displaying the fiat price for the incoming tx.

image.png (131×648 px, 10 KB)

The fiatPrice param is null when passed into xecReceivedNotificationWebsocket from processChronikWsMsg

which is strange at first glance because initializeFiatPriceApi is executed on page load, which should have then called fetchBchPrice, which sets the price via setFiatPrice.

This isn't a stub approach where you're planning a subsequent diff for the fiat price?

Good catch. Looks like it's getting fiatPrice value at the time the websocket is initialized. Since fiatPrice is initialized as null, this is what is being used. Will get a fix...the function needs access to the current value of fiatPrice in state.

Passing latest values of state variables required by websocket onMessage routine to websocket on Message routine

Price feed coming through all ok now

This revision is now accepted and ready to land.Jun 7 2022, 00:25