Page MenuHomePhabricator

[Cashtab] [Chronik Websocket Notifications] [Part 10] If ws connection active, hide api notifications
ClosedPublic

Authored by bytesofman on May 30 2022, 23:21.

Details

Summary

T2447

Depends on D11540

This is the last part of a 10 part stacked diff to enable the feature of incoming tx notifications from websockets in Cashtab.

While this first feature 'win' is trivial, this websocket trigger will be expanded to manage wallet utxo operation going forward (instead of checking an API call at regular intervals), significantly improving the performance of the app.

Test Plan

npm test for new function and unit tests

npm start
Receive an eToken tx and notice only one notification is fired
Receive an XEC tx and notice only one notification is fired

Diff Detail

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

Event Timeline

emack requested changes to this revision.Jun 7 2022, 06:59
emack added a subscriber: emack.

The chronik-client not handling "block found" messages from D11534 seems to be more than just a mere annoyance in the context of this diff. When the wallet receives an inbound XEC tx, the ws notification is displayed all ok, with no api notifications as expected. However, if you wait a little, as soon as this unknown message error comes up in console, either cashtab or chronik seems to trigger a repeat the previous inbound XEC transaction notification.

image.png (807×650 px, 243 KB)

To reproduce per above screen shot:

  1. send some XEC to this wallet and observe ws notification only
  2. go make some coffee and wait for that uncaught error to rear its head (generally takes a few minutes)
  3. observe cashtab proceeding to repeat the previous notifications

I can confirm this is also the case for inbound eToken transactions.

FWIW, this only occurs for the first unknown message error. Subsequent unknown message errors do not result in chronik repeating the previous notification.

Not sure whether this can be mitigated within our codebase or more of a tobias convo for the client.

This revision now requires changes to proceed.Jun 7 2022, 06:59
emack accepted this revision.EditedJun 7 2022, 07:50

The chronik-client not handling "block found" messages from D11534...

After reviewing part 11 (D11554), the logic to filter out non-AddedToMempool events mitigates the aforementioned issue. We still need to make a note somewhere that this issue needs to be resolved (separate to this diff) before we get to the custom ws message diffs.

This revision is now accepted and ready to land.Jun 7 2022, 07:50