The service_name.store.records is not updating just replace the last item
See original GitHub issueSteps to reproduce
I have one project ReactNative and Feathers with a service lets say service_logs
Behavior
- I create a new service_log: SERVICES_DEVICE_LOGS_CREATE_PENDING
- Service create the device: SERVICES_DEVICE_LOGS_CREATE_FULFILLED
- But in the service_logs.store.records (SERVICES_DEVICE_LOGS_STORE) I get the last item “replace” for the new one. See the image:
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
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}));
});
RealTimesV[s] = serviceRT;
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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Recordset Not Updating Table with Changed and/or Correct ...
From Access I can open the query, make any changes needed to any of the fields, save the record and see the changes...
Read more >Bug: patching/updating last row in collection
Quick answer is that Patch affects the first record in the target table that matches the 2nd argument. In this case, First(collectiontable) is...
Read more >Field in Record Collection Variable not Updated after Loop ...
In the Update Records element I simply use record collection variable to update my Contacts' Email field. However in debug log, changes to...
Read more >Flow Element: Update Records - Salesforce Help
Flow Element: Update Records. Identify Salesforce records to update, and set the values to change in those records. To do so, use the...
Read more >Records - Real World OCaml
A record represents a collection of values stored together as one, ... code that should be updated to react to the presence of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
store
method just copies the param to the Redux store.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.
@hugomosh Did you actually dispatch the STORE action actively yourself through
redux-saga
orfeathers-offline-realtime
? Or is feathers-redux supposed to dispatch the STORE action automatically after saySERVICE_FIND_FULFILLED
?@eddyystop you may answer this is well of course 👍
EDIT: My fault. Saw it in your code sample…