Skip to content

Commit 8dbe69a

Browse files
Mohit TejaniMohit Tejani
authored andcommitted
update emitEvent for assigning property opertaion for subscribe and unsubscribe execution
1 parent 2d3a5bf commit 8dbe69a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/event-engine/states/handshaking.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ HandshakingState.on(handshakeSuccess.type, (context, { payload }) =>
7777
category: categoryConstants.PNConnectedCategory,
7878
affectedChannels: context.channels.slice(0),
7979
affectedChannelGroups: context.groups.slice(0),
80+
operation: RequestOperation.PNSubscribeOperation,
8081
currentTimetoken: !!context.cursor?.timetoken ? context.cursor?.timetoken : payload.timetoken,
8182
}),
8283
],

src/event-engine/states/receiving.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,18 @@ ReceivingState.on(disconnect.type, (context, event) => {
146146
return ReceiveFailedState.with({ ...context, reason: errorReason }, [
147147
emitStatus({
148148
category: categoryConstants.PNDisconnectedUnexpectedlyCategory,
149+
operation: RequestOperation.PNUnsubscribeOperation,
149150
error: errorReason.status?.category,
150151
}),
151152
]);
152153
}
153154
});
154155

155156
ReceivingState.on(unsubscribeAll.type, (_) =>
156-
UnsubscribedState.with(undefined, [emitStatus({ category: categoryConstants.PNDisconnectedCategory })]),
157+
UnsubscribedState.with(undefined, [
158+
emitStatus({
159+
category: categoryConstants.PNDisconnectedCategory,
160+
operation: RequestOperation.PNUnsubscribeOperation,
161+
}),
162+
]),
157163
);

0 commit comments

Comments
 (0)