Simple question: How does "listStrategy: 'smart'" work ?
hong-duc opened this issue · comments
I have a simple client with no auth, a simple feathers server with custom service and models and no auth. Both have socket.io
plugin
And one line of code
this.feathers.service('messages').watch().find().subscribe(value => {
console.log('message',value)
})
With listStrategy: 'smart'
it does not run when I create a new message, but when I change to always
it work normal
I know I am missing something here, but without knowing more I cannot make the right config
This should work without using always
as long as the idField
option is set accordingly.
I have set the idField
to my model id field message_id
this._feathers
.configure(feathersSocketIOClient(this._socket)) // add socket.io plugin
.configure(
feathersRx({
// add feathers-reactive plugin
idField: 'message_id'
})
)
The create
rest method return this object
{message: "asd", message_id: "7a650496-2b65-55d3-9644-c95ca3bf1b81"}
The find
rest method return this array
[{message_id: "2cd56894-44ec-5ba2-aac7-e88cc93ca6df", message: "asdas", others_data: null, created_at: "2018-10-16T10:26:22.615Z", room_id: null}]
But watch
still not run again when I create new message, what are the rule here ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.