-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The service_name.store.records is not updating just replace the last item #27
Comments
The This repo, like other Feathers repos, does not deep clone objects because of the performance cost. Passing a cloned object will avoid side effects and perhaps resolve this. |
Copy of PMs on this issue: |
I found your code if (s == 'device_logs') {
options = {
uuid: true ,
sort: Realtime.multiSort({created_at: -1})
}
}
const serviceRT = new Realtime(serviceN, options);
serviceRT.on('events', (records, last) => {
store.dispatch(services[s].store({connected: serviceRT.connected, last, records}));
}); |
I assume you a serviceRT.connect() at some point. [11:47] But first check that each of your records has a unique uuid [edit: since you use the [6:56] [6:58] |
Yes, indeed the error was plain simple, we used the table_name_id standard
so we did't have the id field. And recently we changed to postgres instead
of json DB so the uuid was not taking effect.
We created a fork to add the name of the identifier column in the options
of the RealTime configuration. And it has been working like a charm.
Thank you for all the patience and comments.
El jue., 17 de ago. de 2017 a la(s) 09:32, Eddyystop <
notifications@github.com> escribió:
… I assume you a serviceRT.connect() at some point.
[11:47]
Please add an app.service(name).on('created', data => console.log(data))
as well as updated, patched, removed someplace. Please log records & last
inside serviceRT.on('events', (records, last) => {. This will allow us to
see the mutations occurring and the state of the store.
But first check that each of your records has a unique uuid [edit: since
you use the uuid: true option]. A uuid is just like id || _id. Duplicates
are updates not creates. There's how the replicator generates uuid's
https://github.com/feathersjs/feathers-offline-realtime/blob/master/src/commons/utils/cryptographic.js
[6:56]
Just noting your issue url here for myself #27
<#27>
[6:58]
And if you don't have a uuid field you need a unique id or _id field.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA21ehmdaBQQJyg1r_r45jakkz6OeVwbks5sZEpngaJpZM4O4GTq>
.
|
Just to be clear, you added the name of the |
@hugomosh Did you actually dispatch the STORE action actively yourself through @eddyystop you may answer this is well of course 👍 EDIT: My fault. Saw it in your code sample..... |
Steps to reproduce
I have one project ReactNative and Feathers with a service lets say service_logs
Behavior
It should keep the full list, not replacing the last item. You see 301,299,298,... When it should be 301,300,299,298,...
I do something like this to connect RealTime
And then I do an action to connect to the service.
I am not sure if this weird behavior is on the server side or the real time.
Thanks.
The text was updated successfully, but these errors were encountered: