Page MenuHomePhabricator

[alias-server] [p15] Only add alias records if alias is unique
ClosedPublic

Authored by bytesofman on Feb 21 2023, 23:49.

Details

Summary

T2922

Depends on D13151

Only add alias records that are not already in the database

Test Plan

sudo systemctl start mongod
In mongod, delete the ecashAliases database:

use ecashAliases
db.dropDatabase()

Run node index.js in web/alias-server
Note aliases are added to database
Run node index.js again
Note no aliases are added but all are processed

Diff Detail

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

Event Timeline

emack requested changes to this revision.Feb 24 2023, 05:17
emack added a subscriber: emack.

after dropping the db in mongosh, running node index.js to insert the aliases and then running node index.js a second time, I'm still seeing insertedCount as 131.

image.png (261×715 px, 70 KB)

This revision now requires changes to proceed.Feb 24 2023, 05:17

after dropping the db in mongosh, running node index.js to insert the aliases and then running node index.js a second time, I'm still seeing insertedCount as 131.

image.png (261×715 px, 70 KB)

Tracked via T2947

This revision is now accepted and ready to land.Feb 24 2023, 20:31