Discussion: 409 ALREADY_EXISTS Error Code for Subscription Consistency #435
Replies: 2 comments 2 replies
-
From our view, it will be needed to check below points for the 409 ALREADY_EXISTS criteria (that is the way we do): 2-legged mode
3-legged mode
(*) |
Beta Was this translation helpful? Give feedback.
-
Thanks @ravindrapalaskar17 for bringing this topic into the discussion. In the context of geofencing, there are valid scenarios where duplicate subscriptions for the same phone number, event type, and area might be required.
To achieve this, clients may create multiple subscriptions that are identical in all fields except the sink URL:
Each subscription exists to serve a distinct stakeholder with different processing needs. In this case, allowing duplicates is reasonable and aligned with real-world multi-party use cases. Horeover, if the sink URL is also identical (e.g., all use https://warehouseA.example.com/notify), it becomes a clear case of redundancy. In such instances, we can reject exact duplicates—those matching on phoneNumber, type, area, and sink—with a 409 ALREADY_EXISTS error, aligning with the stricter approach of the "Device Status Subscription" API. So I will go with Option 2, where the potential use cases allowing such scenarios are clearly documented to avoid confusion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, different subscription APIs handle duplicate subscriptions inconsistently when a subscription is created using phoneNumber.
For example:
SIM Swap Subscription and Device Location (Geofencing) allow multiple subscriptions for the same phone number.
Device Status Subscription throws a 409 ALREADY_EXISTS error, but it considers both phoneNumber and type before determining duplication.
Discussion Points:
Should we enforce a common rule for all subscription APIs?
Option 1: Throw a 409 ALREADY_EXISTS error when a subscription is created with the same phoneNumber.
Option 2: Allow multiple subscriptions for the same phoneNumber, but only when a valid use case and reason are provided.
What should be the criteria for determining a duplicate subscription?
Should it be based only on phoneNumber?
Should we consider additional parameters (e.g., subscriptionType, reason)?
How should we handle exceptions consistently across all subscription APIs?
If we decide to allow multiple subscriptions, should we add a standard mechanism to validate the use case before permitting them?
The goal is to finalize a consistent approach for handling duplicate subscriptions across all APIs, ensuring alignment and clarity. Looking forward to your inputs!
Beta Was this translation helpful? Give feedback.
All reactions