[Bug]: "End now" on a subscription can return 404 although the subscription ended
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Read portals/api-portal/src/services/subscriptionService.js and portals/api-portal/src/services/billing/paymentEventService.js, then trace the immediate deletion path and the customer.subscription.deleted webhook. Reproduce the timing in the API Portal billing journey against the testbench Stripe mock. Done means an immediate end returns success whether the webhook or request removes the subscription row first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Please select the area the issue is related to
DeveloperPortal
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
Ending a paid subscription immediately ("End now", DELETE /api/v0.9/subscriptions/{id}?immediate=true) can return 404 "Subscription not found" even though the subscription was ended. The API Portal then shows "Failed to remove subscription: Not Found".
Two paths remove the same subscription row, and whichever runs second finds nothing:
- The request.
deleteSubscription(portals/api-portal/src/services/subscriptionService.js) ends the subscription with the payment provider (subscriptionBillingService.endInProvider,immediate: true), then removes the row itself in a transaction. IfremoveSubscriptionremoves nothing, it throws a 404. - The webhook. Cancelling the subscription makes the provider send
customer.subscription.deleted.paymentEventService(portals/api-portal/src/services/billing/paymentEventService.js, lines 75–76) reads the ended subscription and removes the same row throughsubscriptionService.removeSubscription.
When the webhook is processed before the request reaches its own removal, the request answers 404 for a subscription it did end.
Observed (UI suite, API Portal billing journey "a developer pays for a flat rate and a usage based plan, follows them and ends them", run against the testbench Stripe mock): https://github.com/wso2/api-platform/actions/runs/44452694997/job/135322505050
DELETE /api-portal/api/v0.9/subscriptions/2eaa99f9-…(cancel at period end):200 {"message":"Your subscription has been cancelled. You will retain access until Dec 19, 2026.","endsAt":"2026-12-19T04:02:49.000Z"}DELETE /api-portal/api/v0.9/subscriptions/2eaa99f9-…?immediate=true("End now"), 2 seconds later:404 {"status":"error","code":"RESOURCE_NOT_FOUND","message":"Not Found","errors":[{"message":"Subscription not found"}]}- The page shows "Failed to remove subscription: Not Found" where the journey expects "Subscription removed successfully!".
The body rules out a provider-side failure: an error from endInProvider (SubscriptionBillingError) is returned with its own code and no errors list. The 404 comes from the row being gone.
Expected
Ending a subscription immediately returns success once the subscription has ended, whichever path removes its row.
Steps to Reproduce
- In the API Portal, subscribe to an API on a flat-rate plan through checkout.
- On the subscription's page, choose to unsubscribe (cancel at period end).
- Choose "End now" and confirm.
- Intermittently, the request returns 404 and the page shows "Failed to remove subscription: Not Found", although the subscription is gone. In CI it depends on whether the provider's
customer.subscription.deletedwebhook is processed before the request removes the row.
Severity Level of the Issue
Severity/Minor (Minor functionality is broken. Doesn't need immediate attention)
Environment Details (with versions)
Current main. API Portal built from source and run by the UI suite (tests/framework, block api-portal-billing) against the testbench Stripe mock, in GitHub Actions.
- Lenguaje dominante
- Go
- Estrellas
- 85
- Forks
- 137
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 247
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
wso2/api-platform#4369 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsAbiertoArea/Policies Aspect/Other Severity/Trivial Type/Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
wso2/api-platform#4355 ·
Los mantenedores suelen responder en 1 día
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wso2/api-platform#4348 ·
Los mantenedores suelen responder en 1 día
-
Aspect/AI Aspect/API. Severity/Major
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
wso2/api-platform#4343 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: content-length-guardrail policy accepts a non-string streamingJsonPath at API creationAbiertoArea/Policies Aspect/Configuration Severity/Minor Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
wso2/api-platform#4330 ·
Los mantenedores suelen responder en 1 día
Todos los issues de wso2/api-platform
Issues similares
-
benchmark
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
mozilla-ai/cq#601 ·
Los mantenedores suelen responder en 1 día
-
documentation migration
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día