Giter VIP home page Giter VIP logo

Comments (7)

daffl avatar daffl commented on September 25, 2024 1

It's probably because of idField not configure properly (which is set to id by default).

app.configure(reactive(RxJS, {listStrategy: 'smart', idField: '_id' }))

Should do it. I'll probably change and make it mandatory.

from feathers-reactive.

beeplin avatar beeplin commented on September 25, 2024

yes, now it works with idField configured.

from feathers-reactive.

daffl avatar daffl commented on September 25, 2024

I'll reopen this as a reminder to make idField mandatory.

from feathers-reactive.

hubgit avatar hubgit commented on September 25, 2024

I just hit this problem (the result list became empty after removing an item), and setting idField fixed it.

I don't suppose feathers-client can get the information about the id field from the server somehow, where it's already been configured?

from feathers-reactive.

daffl avatar daffl commented on September 25, 2024

Not really without adding service introspection which is not trivial to secure properly. I'm still making the change to have the id field being mandatory and potentially throwing an error if an item does not have the id field.

from feathers-reactive.

dottodot avatar dottodot commented on September 25, 2024

I'm experiencing a similar issue but only if I alter the original query.

For example I have a list of items with a published / unpublished status so on first load it shows all published items. If at this point if I mark an item as unpublished the list correctly updates. However if I update the list to say display unpublished items then try to update an item to published I get the behaviour described above where the data is lost.

This is my initial subscription, where the query is a BehaviourSubject

  getItems() {
    this.serviceSub = this.query.mergeMap(query => this.mainService.find({ query: query }));
    this.serviceSub.subscribe(resp => {
      this.total = resp.total;
      this.items = resp.data;
      this.isLoading = false;
    });
  }

This itself works fine in terms of updating the results but any patch updates afterwards fail.

This is what my patch request looks like

  unpublish(id:string, status: boolean) {
    this.mainService.patch(id, {published: status});
  }

from feathers-reactive.

daffl avatar daffl commented on September 25, 2024

Setting idField is now mandatory in v0.5.0 thanks to #58

from feathers-reactive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.