Skip to content
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

V4: Hybrid useFind only returns total and IDs but no items #142

Open
dasantonym opened this issue Aug 29, 2023 · 5 comments
Open

V4: Hybrid useFind only returns total and IDs but no items #142

dasantonym opened this issue Aug 29, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@dasantonym
Copy link

Using version 4.0.0 and Feathers 5.0.8 with WebSockets.

This is probably due to me using the module wrong, but I have a very simple situation that already does (almost) nothing:

const Space = useFeathersService('spaces')
const params = computed(() => ({ query: {} }))
const spaces$ = Space.useFind(params, { paginateOn: 'hybrid' })

Now the returned object spaces$ looks as follows:

spaces$.total -> 3
spaces$.data -> undefined
spaces$.currentQuery -> {
  ids: [...array containing 3 ids...],
  items: [],
  total: 3
}

Strangely it seems that it received the correct data since it has all three IDs that exist in this collection on the server, but I can't get it to give me the corresponding items. I tried spaces$.next(), awaited spaces$.request and called spaces$.find() but nothing seems to have any effect.

@marshallswain marshallswain added the bug Something isn't working label Oct 24, 2023
@marshallswain
Copy link
Owner

Hmm... I'm trying to figure out what would cause this. Does your service have pagination enabled or is it returning a plain array?

@dasantonym
Copy link
Author

Hey @marshallswain, thanks for the response! This problem occurred with pagination enabled.

@palmtown
Copy link

palmtown commented Dec 9, 2023

Hello @marshallswain

First and foremost, thanks for working on this package. Secondly, please note that I am having the same exact issue as described by @dasantonym, except this issues happens in v4.1.1 as well. As mentioned, $messages.total has the correct results, however, the data object is empty.

Also, I set setupInstance for the messages service, logged the output and verified it is receiving and returning the data from the server, however, still no data is populated in the data object. The only way I was able to get useFind to work at all was to paginateOn: "server" however, this lacks the functionality needed for live updates.

@palmtown
Copy link

Note that I was able to trace my issue and opened #155 as it slightly differs from this issue.

@lyricsking
Copy link

lyricsking commented Dec 25, 2023

@palmtown and @dasantonym were you able to solve this? However, you might want to confirm that the id field returned from server matches that which is configured in your store setup i.e where you have you may have something similar to:
defineStore({ idField: 'id', // Here clients: { api }, servicePath, Model: User })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants