@@ -115,7 +115,7 @@ export class WidgetModel extends Backbone.Model {
115
115
attributes : Backbone . ObjectHash ,
116
116
options : IBackboneModelOptions
117
117
) : void {
118
- this . attrLastUpdateMsgId = { } ;
118
+ this . expectedEchoMsgIds = { } ;
119
119
this . attrsToUpdate = new Set < string > ( ) ;
120
120
121
121
super . initialize ( attributes , options ) ;
@@ -235,19 +235,19 @@ export class WidgetModel extends Backbone.Model {
235
235
// we may have echos coming from other clients, we only care about
236
236
// dropping echos for which we expected a reply
237
237
const expectedEcho = data . echo . filter ( ( attrName : string ) =>
238
- Object . keys ( this . attrLastUpdateMsgId ) . includes ( attrName )
238
+ Object . keys ( this . expectedEchoMsgIds ) . includes ( attrName )
239
239
) ;
240
240
expectedEcho . forEach ( ( attrName : string ) => {
241
241
// we don't care about the old messages, only the one send with the
242
242
// last msgId
243
243
const isOldMessage =
244
- this . attrLastUpdateMsgId [ attrName ] !== msgId ;
244
+ this . expectedEchoMsgIds [ attrName ] !== msgId ;
245
245
if ( isOldMessage ) {
246
246
// get rid of old updates
247
247
delete state [ attrName ] ;
248
248
} else {
249
249
// we got our confirmation, from now on we accept everything
250
- delete this . attrLastUpdateMsgId [ attrName ] ;
250
+ delete this . expectedEchoMsgIds [ attrName ] ;
251
251
// except, we plan to send out a new state for this soon, so we will
252
252
// also ignore the update for this property
253
253
if (
@@ -499,7 +499,7 @@ export class WidgetModel extends Backbone.Model {
499
499
}
500
500
rememberLastUpdateFor ( msgId : string ) {
501
501
[ ...this . attrsToUpdate ] . forEach ( ( attrName ) => {
502
- this . attrLastUpdateMsgId [ attrName ] = msgId ;
502
+ this . expectedEchoMsgIds [ attrName ] = msgId ;
503
503
} ) ;
504
504
this . attrsToUpdate = new Set < string > ( ) ;
505
505
}
@@ -679,7 +679,7 @@ export class WidgetModel extends Backbone.Model {
679
679
// keep track of the msg id for each attr for updates we send out so
680
680
// that we can ignore old messages that we send in order to avoid
681
681
// 'drunken' sliders going back and forward
682
- private attrLastUpdateMsgId : any ;
682
+ private expectedEchoMsgIds : any ;
683
683
// because we don't know the attrs in _handle_status, we keep track of what we will send
684
684
private attrsToUpdate : Set < string > ;
685
685
}
0 commit comments