Skip to content

Commit

Permalink
fix(DeviceService): Prevent the manager from publishing stable state …
Browse files Browse the repository at this point in the history
…to itself
  • Loading branch information
speigg committed May 2, 2017
1 parent 249dcfe commit 8931d18
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/argon.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -23844,7 +23844,7 @@ $__System.register('1', ['2', '3', '3b', '4', '9', '10', 'a', '1f', '32', '41',
JulianDate.now(this._publishTime);
for (var id in this._subscribers) {
var session = this._subscribers[id];
if (session.version[0] > 0) {
if (session.version[0] > 0 && session !== this.sessionService.manager) {
for (var k in stableState.entities) {
delete stableState.entities[k];
}
Expand Down
2 changes: 1 addition & 1 deletion dist/argon.js
Original file line number Diff line number Diff line change
Expand Up @@ -29424,7 +29424,7 @@ $__System.register('1', ['2', '3', '3b', '4', '9', '10', 'a', '1f', '32', '41',
JulianDate.now(this._publishTime);
for (var id in this._subscribers) {
var session = this._subscribers[id];
if (session.version[0] > 0) {
if (session.version[0] > 0 && session !== this.sessionService.manager) {
for (var k in stableState.entities) {
delete stableState.entities[k];
}
Expand Down
4 changes: 2 additions & 2 deletions dist/argon.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import {
SerializedEntityStateMap,
SubviewType,
ContextFrameState,
GeolocationOptions
GeolocationOptions,
Role
} from './common'

import {
Expand Down Expand Up @@ -1034,7 +1035,7 @@ export class DeviceServiceProvider {
JulianDate.now(this._publishTime);
for (const id in this._subscribers) {
const session = this._subscribers[id];
if (session.version[0] > 0) {
if (session.version[0] > 0 && session !== this.sessionService.manager) {
for (const k in stableState.entities) {delete stableState.entities[k]};
this.contextServiceProvider.fillEntityStateMapForSession(session, this._publishTime, stableState.entities);
session.send('ar.device.state', stableState);
Expand Down

0 comments on commit 8931d18

Please sign in to comment.