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

feat: Handle queries that fetch Konnectors by channel #1534

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Sep 19, 2024

fetchJSON() calls are not compatible with offline mode unless we wrap them in the .query() dsl

Recently we added a fetchJSON() call inside of cozy-home in order to display the new grouped-by-category folders in the home's konnectors section

So we want to move this call inside of the AppsRegistryCollection in order to make it compatible with offline mode

Related PR: cozy/cozy-home#2186

const fetchKonnectorsByChannel = async (channel, doctype, stackClient) => {
const resp = await stackClient.fetchJSON(
'GET',
`/registry?versionsChannel=${channel}&filter[type]=konnector&limit=300`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we cannot increase the limit from the app anymore (we might need eventually to extend the getById to allow options), I would increase it from 300 to 500

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here: https://github.com/cozy/cozy-client/compare/2fcf290a895419d01418d30bbc828d5d2c631c3d..ecb276d3a2c4d74390b69572ea5e16387ec5be9d

I would suggest to skip the "options" thing and to implement it if we need to change the value someday.

Base automatically changed from feat/improve_cozylink_typing to feat/meta_offline September 23, 2024 16:46
`fetchJSON()` calls are not compatible with offline mode unless we wrap
them in the `.query()` dsl

Recently we added a `fetchJSON()` call inside of cozy-home in order to
display the new grouped-by-category folders in the home's konnectors
section

So we want to move this call inside of the AppsRegistryCollection in
order to make it compatible with offline mode

Related PR: cozy/cozy-home#2186
@Ldoppea Ldoppea merged commit 0bee9ae into feat/meta_offline Sep 24, 2024
2 checks passed
@Ldoppea Ldoppea deleted the feat/handle_fetch_konnectors branch September 24, 2024 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants