Idempotent Request In Flight
idempotency-key-in-flight · 409
يوجد طلب سابق بالـ Idempotency-Key نفسه ما زال يعمل، فلن تشغل الـ API العملية مرتين في الوقت نفسه.
كل الصفحات
وهذه هي الحماية تعمل كما يجب، لا نداء فاشلا.
إضافة إلى الحقول التي في كل خطأ، يضيف هذا النوع idempotencyKey، endpoint و errors.
- انتهت مهلة العميل عنده فأعاد المحاولة، بينما كان الطلب الأول يعمل على الخادم.
- اثنان من الـ workers التقطا المهمة نفسها وأرسلاها بالمفتاح نفسه.
- انتظر ثم أعد المحاولة بالمفتاح نفسه. عندما ينتهي الطلب الأول، تعيد لك المحاولة جوابه المحفوظ.
- لا تنشئ مفتاحا جديدا لتتجاوز هذا. المفتاح الجديد يشغل العملية مرة ثانية فعلا.
- اقرأ
endpointلتتأكد أي عملية تعمل قبل أن تقرر الانتظار.
json
{
"type": "idempotency-key-in-flight",
"title": "Idempotent Request In Flight",
"detail": "A request with Idempotency-Key '0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401' is still in flight. Retry shortly to receive the stored response.",
"idempotencyKey": "0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401",
"endpoint": "POST /v1/projects/:projectId/services",
"errors": [
{
"field": "Idempotency-Key",
"message": "an earlier request with this key has not completed yet",
"value": "0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401"
}
],
"requestId": "req-1785231000000-4f7b2c9ae",
"timestamp": "2026-07-28T09:30:00.000Z",
"path": "/v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
"method": "POST",
"instance": "POST /v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
"status": 409,
"docs": "https://ghaym.me/docs/errors/idempotency-key-in-flight"
}