Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: transaction checker app (#2) #8

Merged
merged 5 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: add TODO for handling payload loss in Mirror Node errors (#2)
Signed-off-by: Michał Walczak <[email protected]>
mwb-al committed Jan 28, 2025

Verified

This commit was signed with the committer’s verified signature.
mwb-al Michał Walczak
commit ae80e7184bf70ac3e21240ad1d1fe91cbd888ff0
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ export function mirrorWorker(id: number) {
} catch (error) {
Copy link
Collaborator

@mp-arianelabs mp-arianelabs Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make any error repeated if something inside constantly fails, is this desired?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code does not lead to an infinite loop because the payload is removed from the mirrorQueue using shift() and is not reprocessed in case of an error. However, when the Mirror Node is unavailable and returns an error, we lose such a payload. Addressing this was not part of this task, but I will add a TODO comment to the code - ae80e71

console.error(`Mirror Worker ${id} failed to get the status of transaction ${payload.transactionId}: ${error}`);
await sendAndLogToFile(payload, '', `Error getting status from node, transaction failed or not executed (mirror node): ${error}`);
// TODO: Implement error handling to prevent payload loss when Mirror Node is unavailable.
}
}
}