8000 Idb by paultranvan · Pull Request #1601 · cozy/cozy-client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Idb #1601

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
8000
from
Open

Idb #1601

wants to merge 7 commits into from

Conversation

paultranvan
Copy link
Contributor
@paultranvan paultranvan commented Apr 11, 2025

This is the equivalent of #1598 , but for IndexedDB, so this time for browser.

I will complete with performances measure later

@@ -1,2 +1,3 @@
export { default } from './CozyPouchLink'
export { default as SQLiteQuery } from './db/sqlite/sqliteDb'
export { default as IndexedDBQueryEngine } from './db/idb/idb'
Copy link
Member

Choose a reason for hiding this comment

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

The naming is not homogenous with SQLiteQuery (you added the Engine suffix)

Comment on lines 29 to 31
const request = version
? indexedDB.open(fullDbName, version)
: indexedDB.open(fullDbName)
Copy link
Member

Choose a reason for hiding this comment

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

Version is used there, but we never provide it? Do we expect to use it in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is never provided, but it might be (and I tried few things during tests), so I prefer to keep it for now

}

async openDB(dbName, version = undefined, { forceName = false } = {}) {
return new Promise((resolve, reject) => {
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ openDB() is not declared as async in dbInterfaces file, but more important, it is not awaited in PouchManager

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

10000
return resp
} catch (err) {
logger.error(err)
return null
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ the dbInterfaces files does not declare allDocs to return a nullable type

Copy link
Contributor Author
@paultranvan paultranvan Apr 24, 2025

Choose a reason for hiding this comment

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

Right, I fixed the interface, it was already returning null in sqlite

limit,
partialFilter,
skip = 0,
shouldRecreateIndex = false
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 find any code that set shouldRecreateIndex. Is that a change that will be implemented later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is helpful to quickly set this for debug purposes

@paultranvan paultranvan marked this pull request as ready for review April 24, 2025 10:14
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
0