add a third argument for the listen callback (client.record.listen
and client.event.listen
) which contains
an object which two functions (accept
and reject
). One of these functions needs to be called otherwise you
will get a deprecated message. #203 #212
This enhancements fixes some issues like #74 #155 #170
Records supports now a boolean flag (record.hasProvider
) which indicates whether a listener has accepted providing data. You can also subscribe to event which is triggered when the flag changes:
record.on('hasProviderChanged', hasProvider => {
/* do something */
})
API checks are now in place that throw an error if you provide the incorrect argument amount or types #207 by @ronag
Gherkin tests are now used for E2E testing, allowing e2e tests to be run against any language rather than just node, and allows writing more scenarios much easier
- allow do create and discard the same record in a synchronous loop #167
- record snapshots are not waiting for
isReady
#140 - record subscriptions are not waiting for
isReady
in combination withtriggerNow
#138 - broken unsubscribe due to wrong internal argument delegation #190
- Terminate unauthenticated connections after a timeout #226
- Fixed issue where deleted record was not getting removed
Users can now set a global and per record merge strategy. This allows the application to respond to VERSION_EXISTS
and use a REMOTE_WINS
, LOCAL_WINS
or a custom merge strategy
Global:
const client = deepstream( 'localhost:6020', {
mergeStrategy: deepstream.MERGE_STRATEGIES.REMOTE_WINS
});
Local:
const record = client.record.getRecord( 'user/1' )
record.setMergeStrategy( ( record, remoteValue, remoteVersion, callback ) => {
callback( null, remoteValue )
} )
deepstream protocol now has a connection establishment handshake that allows the client to be redirected to another deepstream before requesting/publishing data
Users can now delete content within records by setting it to undefined
record.set( path, undefined )
Client size bundle has been reduced by not including mocks for the tcp connection
Record discards and deletes now get called after when ready, which makes the API cleaner
Before:
record = client.record.getRecord( 'user1' )
record.set( 'name', 'bob' )
record.onReady( () => {
record.discard()
})
Now:
record = client.record.getRecord( 'user1' )
record
.set( 'name', 'bob' )
.discard()
You can now access constants on deepstream
// on the constructor
const C = deepstream.CONSTANTS;
// and instance
const client = deepstream( 'localhost:6020' )
CONST C = client.CONSTANTS;
The login callback now only takes two arguments instead of three. This is to make it easier for the user to send their own custom data from an authentication hander or when using the http authentication handler
client.login( {}, ( success, data ) => {
if( success ) {
// data is meta data associated with user session
// or null
} else {
// data is error message or custom error object
// with reason why or null
}
} )
We now use deepstream
instead of engine.io
as the default engineio path
-
Login after logout doesn't overide auth parameters #88
-
Deepstream not updating object properties #96 ( @drsirmrpresidentfathercharles )