farmOS / farmOS.js

A JavaScript library for working with farmOS data structures and interacting with farmOS servers.
MIT License
17 stars 13 forks source link

Non core entity types are not retrieved #85

Open duarteoctavio opened 1 year ago

duarteoctavio commented 1 year ago

Describe the bug Entities of the type profile are not obtained when using the fetch method. Trying to retrieve them using the farm.fetch('profile', 'common') without success.

To Reproduce Steps to reproduce the behavior:

  1. Initiate a farmos object, a farm which includes the desired profile--common schema is ourscitest. Here is the schema.
  2. Fetch all entities.
  3. If you try to call the methods associated with core types such as log, they work, but there's nothing similar for profile.
jgaehring commented 1 year ago

Hm, oh interesting. I'll confess I did not do much to test fetching actual profiles themselves, just the schemata. I can take a closer look later this week, but my first intuition is to find out if it works to fetch the resource with farm.request('/api/profile/common') and/or with curl or some other API tooling.

duarteoctavio commented 1 year ago

Sorry! I meant the schema. I used entity across the whole issue, but I really meant the schema for those en entity types.

jgaehring commented 1 year ago

Hey, sorry I haven't found a chance to connect synchronously. Best to email me if you want to schedule something, or I can just respond here.

I just tried this test again on my local machine, and it still works for me:

https://github.com/farmOS/farmOS.js/blob/7e2bc255ca64061ccbb8838a3bae228adf2f8e16/test/profile-support.js#L30-L38

The only changes I made to farmOS.js on top of main are the test itself, which I originally wrote way back when first testing these profile entities, plus 7e2bc25 to reflect the changes in #67. And main has only 2 commits (a non-code commit, 63c0479, and a bit of extra testing added, 98d2b39) ahead of the latest version 2.0.0-beta.16, which I released back in February to include the changes for subrequests #83.

My farmOS installation is version 2.x-dev, with the farm_profile and farm_profile_common modules installed. I think it was last updated March 2022, but maybe something has changed server-side since then, either in the modules or farmOS core?

@mstenta, any guesses if something might have changed on that end? And what's the best way to pin down the specific version/commit on my local?

mstenta commented 1 year ago

Hmm nothing has changed that would affect the ability to fetch common profile schema... not that I can think of anyway. :thinking: