-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Access] Unify subscription id with client message id #6847
base: master
Are you sure you want to change the base?
[Access] Unify subscription id with client message id #6847
Conversation
From now on, we use only 1 id in request/response messages. This id is called `subscription_id`. A client may provide `subscription_id` in `subscribe` request. If client does not provide it, we generate it ourselves. Clients that use browsers or other async environemnts may use `subscription_id` to correlate response messages with the request ones. `subscription_id` is used in all messages related to subscription. I also remove `success` field from response. We include `subscription_id` field in a resposne in case of OK response. In case of error response, we include `error` field.
8d1e427
to
e5a91d7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6847 +/- ##
==========================================
- Coverage 41.18% 41.18% -0.01%
==========================================
Files 2109 2109
Lines 185660 185661 +1
==========================================
- Hits 76460 76457 -3
- Misses 102788 102789 +1
- Partials 6412 6415 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
) | ||
return | ||
} | ||
|
||
// register new provider | ||
provider, err := c.dataProviderFactory.NewDataProvider(ctx, msg.Topic, msg.Arguments, c.multiplexedStream) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to provide the subscriptionID
for DataProvider as they will also return formatted response, containing topic and subscription ID fields according to this PR #6846
@@ -25,19 +22,13 @@ func newBaseDataProvider( | |||
subscription subscription.Subscription, | |||
) *baseDataProvider { | |||
return &baseDataProvider{ | |||
id: uuid.New(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this will be not generated, but set outside.
From commit message:
From now on, we use only 1 id in request/response messages. This id is called
subscription_id
.A client may provide
subscription_id
insubscribe
request. If client does not provide it, we generate it ourselves.Clients that use browsers or other async environments may use
subscription_id
to correlate response messages with the request ones.subscription_id
is used in all messages related to subscription.I also removed
success
field from a response. We includesubscription_id
field in a resposne in case of OK response.In case of error response, we include
error
field.Closes #6845