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

Fetch ancestors of taxa we save to Realm #2535

Open
kueda opened this issue Dec 9, 2024 — with Linear · 1 comment
Open

Fetch ancestors of taxa we save to Realm #2535

kueda opened this issue Dec 9, 2024 — with Linear · 1 comment

Comments

Copy link
Member

kueda commented Dec 9, 2024

When we save taxa to the local database from taxon search and when the app loads, we only save the search results, which tend to be leaf taxa, and not their ancestors, which means the local taxa table tends to be missing higher level taxa. This means that even if your local database as a row for Argentine Ant, it probable doesn't have a row for Ants, frustrating those of us who want to observe ants while offline.

We could address this with the existing API by making an additional fetch request for every search result to get those ancestors (ancestors don't come with the /v2/search results), but that would probably make #2277 worse.

Alternative, we could work with the web team to optionally include ancestors in the search results, or maybe make an option to include a full tree in search results in addition to the actual results.

@kueda
Copy link
Member Author

kueda commented Dec 18, 2024

Note, inaturalist/iNaturalistAPI@9612615 added the include_ancestors param to /v2/observations_species_counts and the include_taxon_ancestors param to /v2/search, both of which will be useful here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant