feat: enhance webhook event handling and improve profile fetching logic

- Updated the WebhooksService to differentiate between 'InvoiceSettled' and 'InvoicePaymentSettled' events, ensuring accurate payment confirmation and logging.
- Enhanced the useAccounts composable to improve display name handling by skipping generic placeholder names and ensuring the most recent profile metadata is fetched from multiple relays.
- Modified the IndeehubApiService to handle JWT token refresh failures gracefully, allowing public endpoints to function without authentication.
- Updated content store logic to fetch all published projects from the public API, ensuring backstage content is visible to all users regardless of their active content source.

These changes improve the reliability of payment processing, enhance user profile representation, and ensure content visibility across the application.
This commit is contained in:
Dorian
2026-02-14 12:05:32 +00:00
parent bbac44854c
commit d1ac281ad9
6 changed files with 150 additions and 87 deletions

View File

@@ -63,8 +63,12 @@ export class WebhooksService implements OnModuleInit {
);
switch (event.type) {
case 'InvoiceSettled':
case 'InvoicePaymentSettled': {
// Only process InvoiceSettled — this fires when the invoice is
// confirmed paid. InvoicePaymentSettled fires earlier (when
// payment is received but not yet confirmed) and can cause
// "Invoice not paid" errors due to the invoice still being
// in Processing state.
case 'InvoiceSettled': {
try {
const invoiceId = event.invoiceId;
const invoice = await this.btcpayService.getInvoice(invoiceId);
@@ -97,6 +101,16 @@ export class WebhooksService implements OnModuleInit {
}
}
case 'InvoicePaymentSettled': {
// Payment received but invoice may still be processing.
// We wait for InvoiceSettled to confirm the payment.
Logger.log(
`Invoice ${event.invoiceId} payment received — waiting for InvoiceSettled to confirm`,
'WebhooksService',
);
break;
}
case 'InvoiceExpired':
case 'InvoiceInvalid': {
Logger.log(