Page MenuHomePhabricator

[alias-server] Remove pending txs that have been missed by the websocket
AbandonedPublic

Authored by bytesofman on Mar 28 2023, 03:51.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

T3047

Depends on D13485

pendingAliases are currently only removed on 'confirmed tx' websocket msgs. If the app misses these msgs, the txs are never removed.

websockets disconnect and reconnect frequently so there will be missed msgs. The app must be designed to be robust to this condition.

Right now, the 'on block found' method is. It doesn't matter how many blocks are missed, as soon as one is found the app will catch up to the current state of the blockchain. So, this diff introduces a method to remove pendingAliases that are found confirmed in the on block method.

Test Plan

node index.js
fire off some alias txs
check the /pending endpoint and see them there
confirm they are removed from the endpoint after the txs confirm
add 'return' to line 394 of websocket.js so that the websocket method will not delete pending alias txs
fire off some alias txs
when the server sees them confirm, confirm that the pending endpoint is cleared without the websocket method

Diff Detail

Repository
rABC Bitcoin ABC
Branch
process-only-unprocessed-txs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22787
Build 45194: Build Diff
Build 45193: arc lint + arc unit

Event Timeline

bytesofman added inline comments.
web/alias-server/telegram.js
29 ↗(On Diff #38992)

This change is unrelated to this diff. However, ran into a bug while testing this diff where this function was totally broken using markdown processing. Have a task open to handle it. Wanted it in now as will be deploying this to a test prod instance where I need it to work.