Skip to content

feat: Handle queries that fetch Konnectors by channel#1534

Merged
Ldoppea merged 1 commit intofeat/meta_offlinefrom
feat/handle_fetch_konnectors
Sep 24, 2024
Merged

feat: Handle queries that fetch Konnectors by channel#1534
Ldoppea merged 1 commit intofeat/meta_offlinefrom
feat/handle_fetch_konnectors

Conversation

@Ldoppea
Copy link
Copy Markdown
Contributor

@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: linagora/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
Copy Markdown
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
Copy Markdown
Contributor 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
@Ldoppea Ldoppea force-pushed the feat/handle_fetch_konnectors branch from cf2a800 to 2fcf290 Compare September 23, 2024 16:47
`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: linagora/cozy-home#2186
@Ldoppea Ldoppea force-pushed the feat/handle_fetch_konnectors branch from 2fcf290 to ecb276d Compare September 23, 2024 16:59
@Ldoppea Ldoppea merged commit 0bee9ae into feat/meta_offline Sep 24, 2024
@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