question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The service_name.store.records is not updating just replace the last item

See original GitHub issue

Steps to reproduce

I have one project ReactNative and Feathers with a service lets say service_logs

Behavior

  1. I create a new service_log: SERVICES_DEVICE_LOGS_CREATE_PENDING
  2. Service create the device: SERVICES_DEVICE_LOGS_CREATE_FULFILLED
  3. But in the service_logs.store.records (SERVICES_DEVICE_LOGS_STORE) I get the last item “replace” for the new one. See the image:

captura de pantalla 2017-08-15 a la s 15 39 15

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:open
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
eddyystopcommented, Aug 16, 2017

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.

0reactions
bitflowercommented, Mar 8, 2018

@hugomosh Did you actually dispatch the STORE action actively yourself through redux-saga or feathers-offline-realtime ? Or is feathers-redux supposed to dispatch the STORE action automatically after say SERVICE_FIND_FULFILLED?

@eddyystop you may answer this is well of course 👍

EDIT: My fault. Saw it in your code sample…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found