Skip to content

Commit 4cd7b07

Browse files
author
Aidan Zimmermann
committed
STREAM-1034: auto accept as target not observer
1 parent 633de51 commit 4cd7b07

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/sessions/live-monitoring-session-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class LiveMonitoringSessionHandler extends BaseSessionHandler {
3131

3232
// Auto-accept if current user is the observer (fromUserId matches current user)
3333
if (pendingSession.fromUserId === this.sdk._personDetails?.id) {
34-
this._liveMonitoringObserver = true;
34+
this._liveMonitoringObserver = false;
3535
return this.proceedWithSession(pendingSession);
3636
}
3737

test/unit/sessions/live-monitoring-session-handler.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('handlePropose', () => {
5656
expect(superSpy).not.toHaveBeenCalled();
5757
});
5858

59-
it('should auto-accept as observer when current user is the fromUserId', async () => {
59+
it('should auto-accept as target when current user is the fromUserId', async () => {
6060
const proceedSpy = jest.spyOn(handler, 'proceedWithSession').mockResolvedValue(null);
6161
const superSpy = jest.spyOn(BaseSessionHandler.prototype, 'handlePropose').mockResolvedValue(null);
6262

@@ -65,7 +65,7 @@ describe('handlePropose', () => {
6565

6666
await handler.handlePropose(pendingSession);
6767

68-
expect(handler._liveMonitoringObserver).toBe(true);
68+
expect(handler._liveMonitoringObserver).toBe(false);
6969
expect(proceedSpy).toHaveBeenCalledWith(pendingSession);
7070
expect(superSpy).not.toHaveBeenCalled();
7171
});

0 commit comments

Comments
 (0)