Skip to content

Commit

Permalink
Buxfer version bump, abandon the attempt to update transaction status…
Browse files Browse the repository at this point in the history
… changes from moneyman (#344)

* Bump buxfer minor, abandon the effort to update pending transactions

---------

Co-authored-by: Daniel Hauser <[email protected]>
Co-authored-by: Daniel Hauser <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2024
1 parent 2c13a21 commit 8b18eb1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"azure-kusto-data": "^6.0.2",
"azure-kusto-ingest": "^6.0.2",
"buxfer-ts-client": "^1.0.4",
"buxfer-ts-client": "^1.1.0",
"date-fns": "^3.6.0",
"debug": "^4.3.6",
"dotenv": "^16.4.5",
Expand Down
11 changes: 9 additions & 2 deletions src/storage/buxfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export class BuxferStorage implements TransactionStorage {
const missingAccounts = new Set<string>();

for (const tx of txns) {
const isPending = tx.status === TransactionStatuses.Pending;
// Ignore pending and only upload completed transactions
if (isPending) {
stats.skipped++;
continue;
}

const accountId = this.accountToBuxferAccount.get(tx.account);
if (!accountId) {
missingAccounts.add(tx.account);
Expand All @@ -68,10 +75,10 @@ export class BuxferStorage implements TransactionStorage {
`sending to Buxfer accounts: "${this.accountToBuxferAccount.keys()}"`,
);
const resp: AddTransactionsResponse =
await this.buxferClient.addTransactions(txToSend, true);
await this.buxferClient.addTransactions(txToSend, false);
logger("transactions sent to Buxfer successfully!");
stats.added = resp.addedTransactionIds.length;
stats.existing = resp.duplicatedTransactionIds.length;
stats.existing = resp.existingTransactionIds.length;
stats.skipped += stats.existing;
}

Expand Down

0 comments on commit 8b18eb1

Please sign in to comment.