When sending an HTTP GET request to /subscriptions/{streamId}/{groupName} the returned feed does not contain a groupName property.
Although this property can be retrieved by sending an HTTP GET request to **/subscriptions/{streamId}/{groupName}/info **it adds extra hassle.
This is especially apparent when you want to construct a valid Subscription object which would obviously have streamId and **groupName **properties.
Lets say you have an interface:
interface SubscriptionRepository
{
Subscription find(string streamId, string groupName);
add(Subscription subscription)
}
``
As you can see I must supply the streamId and groupName when retrieving a Subscription.
This would return a fully constructed instance of Subscription. The problem is I need to make two HTTP requests in order to do this.
One to get the subscription and its events (/subscriptions/{streamId}/{groupName}), another to get the group name (/subscriptions/{streamId}/{groupName}/info).
A valid instance of Subscription is important because if I want to pass this object around to say the SubscriptionRepository::add() method it would need
the groupName property in order to successfully send a POST or PUT request to /subscriptions/{streamId}/{groupName}.
This is causing other annoyances as well. I’m creating a browser library which allows you to easily browse through a feed which allows the events to be lazy loaded among other stuff
and this tiny little property missing in the feed is causing all sorts of headaches.
I’d have thought the groupName property would be treated as a first class citizen of the competing subscription feed since it is required if you want to create, retrieve, update or delete
the subscription group.
I know the property can be resolved by getting the last segment of the id property of the feed but that just seems as though it could be brittle and cause breakages in the future
if I depended on that.
Why is it like this? Surely groupName should be returned with each feed or at least if you specify the embed mode to “rich” which gives you piles of data except this key property.