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

Assistant: Add sources #2225

Merged
merged 5 commits into from
Oct 24, 2024
Merged

Assistant: Add sources #2225

merged 5 commits into from
Oct 24, 2024

Conversation

JF-Cozy
Copy link
Contributor

@JF-Cozy JF-Cozy commented Oct 23, 2024

No description provided.

Copy link

bundlemon bot commented Oct 23, 2024

BundleMon

Files updated (4)
Status Path Size Limits
vendors/home.(hash).js
1.54MB (+2.21KB +0.14%) -
app/home.(hash).js
55.82KB (+731B +1.3%) -
intents/home.(hash).js
29.19KB (+121B +0.41%) -
app-home.(hash).min.css
2.18KB (+42B +1.92%) -
Unchanged files (9)
Status Path Size Limits
services/softDeleteOrRestoreAccounts/home.js
464.4KB -
services/updateAccounts/home.js
461.47KB -
services/deleteAccounts/home.js
309.8KB -
services/myselfFromIdenties/home.js
234.35KB -
services/polyfillFetch/home.js
97.37KB -
vendors-home.(hash).(hash).min.css
38.79KB -
services/attributesHelpers/home.js
15.22KB -
intents/index.html
652B -
intents-home.(hash).min.css
158B -

Total files change +3.08KB +0.09%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

src/assistant/Conversations/Sources/Sources.jsx Outdated Show resolved Hide resolved
Comment on lines 77 to 92
const folderByIds = buildFilesByIds(folderIds)
const { data: folders, ...queryResult } = useQuery(
folderByIds.definition,
folderByIds.options
)

const isLoading = isQueryLoading(queryResult)

if (isLoading) return null

const foldersById = keyBy(folders, '_id')

const filesWitPath = files.map(file => ({
...file,
path: foldersById[file.dir_id].path
}))
Copy link
Member

Choose a reason for hiding this comment

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

I don't get this part, isn't the path already present in io.cozy.files that have the type file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

non justement c'est bien le souci, le path n'est que sur les folder

Copy link
Contributor

Choose a reason for hiding this comment

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

On en discute demain mais je t'ai induit en erreur @JF-Cozy

Copy link
Contributor Author

@JF-Cozy JF-Cozy Oct 24, 2024

Choose a reason for hiding this comment

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

à la récupération des io.cozy.files, un .getByIds(ids) ne retourne pas le path, là où un .where({ _id: { $in: ids } }) retourne bien le path. J'ai donc changé la requête en conséquence et simplifié le code. Cette requête est sous-optimale et ne devrait pas être utilisé, on fait comme ça le temps d'apporter un fix à cozy-client ou la stack afin de récupérer le path via .getByIds(ids)

src/assistant/Conversations/Sources/SourcesItem.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@cballevre cballevre left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@JF-Cozy JF-Cozy merged commit 482d17b into master Oct 24, 2024
4 checks passed
@JF-Cozy JF-Cozy deleted the feat/VER-1016 branch October 24, 2024 10:15
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.

3 participants