Page MenuHomePhabricator

[Cashtab] [Chronik Websocket Notifications] [Part 3] Subscribe to Hash160s
ClosedPublic

Authored by bytesofman on May 30 2022, 17:32.

Details

Summary

T2447

Depends on D11531

Part 3 of stacked diff for implementing chronik websocket connections into Cashtab.

This diff uses the getHashArrayFromWallet function defined in Part 2 to obtain + subscribe to the correct addresses.

Test Plan

npm start
Open dev console
Observe subscription to wallet's hash160s through websocket.
Send a tx to the wallet and observe a msg in the console.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
connect-to-chronik-ws
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19181
Build 38110: Build Diffcashtab-tests
Build 38109: arc lint + arc unit

Event Timeline

emack requested changes to this revision.Jun 1 2022, 02:19
emack added a subscriber: emack.
emack added inline comments.
web/cashtab/src/hooks/useWallet.js
956

Based on a simple send tx to the wallet, I'm seeing uncaught exceptions from the ws endpoint in the console below. Needs to be wrapped in a try/catch block.

image.png (190×415 px, 40 KB)

This revision now requires changes to proceed.Jun 1 2022, 02:19
bytesofman added inline comments.
web/cashtab/src/hooks/useWallet.js
956

I am able to recreate this. However, this is not related to the subscriptions or unsubscriptions -- it's something to do with the message event handler. I only get this on the "confirmed" messages, not the "seen" messages. Will check with @tobias_ruck to see if this is on chronik end.

Separately, good catch, I have not configured these notifications to ignore the "confirmed" messages. Will get a task up for that.

With D11554 up, and @tobias_ruck confirming that this error msg is due to this version of chronik-client not handling "block found" messages, I think this is okay to land. The error msg is annoying on this version but does not impact performance.

This revision is now accepted and ready to land.Jun 6 2022, 23:45