-
Notifications
You must be signed in to change notification settings - Fork 123
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
core:realtime:user:unsubscribe:after doesn't report kuid #2524
Comments
Hello @ScreamZ From what I see, if you get the kuid to null instead of the value you need it is because Kuzzle has not been able to getKuidFromConnection. Maybe your sdk in your application isn't properly connected with the user upon refresh ? maybe your are calling the unsubscribe method to soon upon refresh ? Are you able to make a small reproduction of the issue so we can work with that and check if it's really a bug ? // backend side
global.kuzzle.on("core:realtime:user:subscribe:after", (data) => {
console.log("User subscribed to room", data);
});
global.kuzzle.on("core:realtime:user:unsubscribe:after", (data) => {
console.log("User unsubscribed from room", data);
});
// Front side of an application
const roomId = await this.$kuzzle.realtime.subscribe(
"toto",
"tata",
{},
(notification) => {
console.log("Received notification", notification);
}
);
console.log("Room ID", roomId);
await this.$kuzzle.realtime.unsubscribe(roomId); I properly get the kuid in the response object of the event kuzzle | User unsubscribed from room {
kuzzle | requestContext: RequestContext {
kuzzle | 'token': null,
kuzzle | 'user': null,
kuzzle | 'connection': Connection {
kuzzle | 'id': 'a98ea515-5885-44ef-936b-904803031f3a',
kuzzle | 'protocol': null,
kuzzle | 'ips': [],
kuzzle | 'misc': {}
kuzzle | }
kuzzle | },
kuzzle | room: {
kuzzle | collection: 'tata',
kuzzle | id: 'e04221d9d78f8f8cc1594f217ad9c9f71a9e16952a237f24b19df9ec65ba12cf',
kuzzle | index: 'toto'
kuzzle | },
kuzzle | subscription: Subscription {
kuzzle | connectionId: 'a98ea515-5885-44ef-936b-904803031f3a',
kuzzle | roomId: 'e04221d9d78f8f8cc1594f217ad9c9f71a9e16952a237f24b19df9ec65ba12cf',
kuzzle | index: 'toto',
kuzzle | collection: 'tata',
kuzzle | filters: undefined,
kuzzle | kuid: 'admin'
kuzzle | }
kuzzle | } |
Hello,
Trying to use
core:realtime:user:unsubscribe:after
to generate a side effect. I do need to accesssubscription.kuid
field, but when I refresh my browser page I don't have access to kuid which isnull
. Whereas I'm supposed to have thekuid
.Related code :
Create (This is OK, kuid is present)
kuzzle/lib/core/realtime/hotelClerk.ts
Lines 290 to 298 in 96ac03b
This is not OK (kuid missing in unsubscribe)
kuzzle/lib/core/realtime/hotelClerk.ts
Lines 589 to 615 in 96ac03b
The text was updated successfully, but these errors were encountered: