You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constblobService=newBlobStorageService():
Object.assign(blobService,{connectionString: 'some string',type: ServiceTypes.Dispatch});// Should throw but doesn't since we are changing the type erroneously. assert(blobServiceinstanceofBlobStorageService);// trueconstsurprise=BotConfigurationBase.serviceFromJSON(blobService);assert(surpriseinstanceofBlobStorageService);// throwsassert(surpriseinstanceofDispatchService);// Oops! Changed the class type.assert('connectionString'insurprise);// 'connectionString' is a property of BlobStorageService but somehow arrives in a DispatchService instance
The shape of service data models are not necessarily reliable and seemingly completely interchangeable which can lead to failures when using the instanceof operator or erroneously setting the wrong type on a "typed" data model instance.
One would expect the type field to be read-only and properties that do not belong to the data model to be omitted from the instance.
The text was updated successfully, but these errors were encountered:
The reason is that you have components that might not be in sync as to the objects which are stored in the .bot file. If you run a tool which is older you want to "round-trip" properties which aren't understood (because they are new), or types which aren't understood (because they are new).
Given this example:
The shape of service data models are not necessarily reliable and seemingly completely interchangeable which can lead to failures when using the
instanceof
operator or erroneously setting the wrong type on a "typed" data model instance.One would expect the
type
field to be read-only and properties that do not belong to the data model to be omitted from the instance.The text was updated successfully, but these errors were encountered: