Skip to content

Conversation

paultranvan
Copy link
Contributor

@paultranvan paultranvan commented Oct 2, 2025

File paths are not stored in PouchDB. Therefore, we keep a Map of paths in-memory, for fast retrieval.
This PR adds 2 fixes:

  • The Map was not properly initialized, because we failed to correctly retrieve the parent path from database
  • Updates on file paths were not properly handled

Note the paths were still properly displayed to the user at search time, because the paths handling was originally done on search side: https://github.com/cozy/cozy-libs/blob/master/packages/cozy-dataproxy-lib/src/search/helpers/filePaths.ts

But this is better to mutualize the logic here, so both search and pouch queries can benefit from it. So we'll eventually remove the paths handling on dataproxy search.

Because of this, paths Map was not properly initialized
We keep file paths in-memory for fast retrieval, as they are not stored
in database.  If a file was updated, its path was not correctly updated
in the paths Map.
@paultranvan paultranvan merged commit e87a55c into master Oct 3, 2025
3 checks passed
@paultranvan paultranvan deleted the filePaths branch October 3, 2025 14:01
paultranvan added a commit to cozy/cozy-libs that referenced this pull request Oct 3, 2025
paultranvan added a commit to cozy/cozy-libs that referenced this pull request Oct 3, 2025
paultranvan added a commit to cozy/cozy-libs that referenced this pull request Oct 3, 2025
paultranvan added a commit to cozy/cozy-libs that referenced this pull request Oct 3, 2025
paultranvan added a commit to cozy/cozy-web-data-proxy that referenced this pull request Oct 3, 2025
paultranvan added a commit to cozy/cozy-web-data-proxy that referenced this pull request Oct 3, 2025
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