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

[Reputation Oracle] Improved webhooks #2658

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

eugenvoronov
Copy link
Contributor

Description

Reworked the processPaidWebhooks cron job to improve the handling of webhook notifications and prevent unnecessary retries of completed escrows. The goal is to implement a webhook queue that effectively tracks which notifications have failed to be sent.

Summary of changes

  • Webhook model updated: Renamed WebhookIncomingEntity to WebhookEntity and introduced a type enum field to differentiate between incoming and outgoing webhooks. Added fields for failedReason and callbakUrl to enhance error tracking.
  • Added new cron job enum process-outgoing-webhook value.
  • Tracked incoming webhooks: Implemented a cron module that monitors WebhookEntity entries with type: in and pending status. This module checks escrow status and processes escrows accordingly.
  • Created outgoing webhooks: Three WebhookEntity instances with type: out and pending status are generated for sending notifications.
  • Updated webhook status: The status of WebhookEntity entries with type: in is updated to completed once processing is successful.
  • Tracked outgoing webhooks: A separate cron module monitors WebhookEntity entries with type: out. It attempts to send notifications using webhookService.sendWebhook(), handling retries and failures appropriately.
  • Migration and testing: Updated migrations and added unit tests to ensure functionality.

How test the changes

yarn test

Related issues

[Reputation Oracle] Refactor processPaidWebhooks method #2638

@eugenvoronov eugenvoronov self-assigned this Oct 18, 2024
Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
human-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 0:02am
human-dashboard-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 0:02am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
faucet-frontend ⬜️ Ignored (Inspect) Visit Preview Oct 30, 2024 0:02am
faucet-server ⬜️ Ignored (Inspect) Visit Preview Oct 30, 2024 0:02am

@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend October 23, 2024 12:17 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants