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

Provider-level offline support #354

Merged
merged 29 commits into from
Dec 16, 2024
Merged

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Dec 11, 2024

This builds on top of #352 to add offline support to the Y-Sweet provider. It's also exposed through the React bindings by passing enableOfflineSupport={false,true} to YDocProvider.

The approach is similar to y-indexeddb, where updates are stored incrementally and then compacted when the set of updates gets large.

Browsers generally store indexeddb in plain text on disk. We encrypt the data using AES-GCM, and store the key in a cookie. Since cookies often store credentials, they are often treated more sensitively than local storage (Chrome encrypts them on disk, and stores the decryption key in the OS's keychain; Firefox and Safari still use plaintext.)

Each document gets its own "database" in indexeddb, but the key is shared across the origin.

Since multiple tabs can have the same document open, they attempt to coordinate:

  • Before writing to the database, we attempt to fetch any updates we haven't seen and apply them
  • When a client updates, it broadcasts a message telling other clients to update

Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
y-sweet-demos ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 10:46pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
y-sweet-debugger ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:46pm
y-sweet-gendocs ⬜️ Ignored (Inspect) Visit Preview Dec 16, 2024 10:46pm

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 59135b9 in 55 seconds

More details
  • Looked at 1273 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_QBW6xBQvEZGgykds


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 192922b in 16 seconds

More details
  • Looked at 107 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js-pkg/client/src/indexeddb.ts:88
  • Draft comment:
    Ensure the transaction completes before proceeding by returning a promise that resolves on transaction completion. Also, objectCount should be reset to 1 after clearing and adding the new state.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. js-pkg/client/src/indexeddb.ts:93
  • Draft comment:
    Consider handling transaction completion to ensure data consistency.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_ibOiqsqLjlX1duar


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 2fe57df in 37 seconds

More details
  • Looked at 174 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js-pkg/client/src/encryption.ts:1
  • Draft comment:
    Consider using TextDecoder and TextEncoder for more efficient base64 conversion.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The arrayBufferToBase64 and base64ToArrayBuffer functions can be optimized using modern JavaScript methods.
2. js-pkg/client/src/indexeddb.ts:101
  • Draft comment:
    Consider adding error handling for the transaction in saveWholeState to ensure data integrity.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_c9wc8eRtj5zHqx4k


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

js-pkg/client/src/keystore.ts Show resolved Hide resolved
js-pkg/client/src/indexeddb.ts Outdated Show resolved Hide resolved
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 4e06920 in 2 seconds

More details
  • Looked at 28 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/indexeddb.ts:82
  • Draft comment:
    The async keyword is unnecessary here as there are no asynchronous operations inside the onsuccess handler. Consider removing it.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of async in the onsuccess handler is unnecessary since the handler itself does not perform any asynchronous operations.

Workflow ID: wflow_n9pzrN12eAmmuaHk


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@jakelazaroff jakelazaroff left a comment

Choose a reason for hiding this comment

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

Mostly style / conciseness related.

Re: compaction, is there a benefit to storing the last N updates individually in IndexedDB?

  • If there is, we could iteratively compact the oldest two updates with Y.mergeUpdates. This means the oldest update will asymptotically grow to be the full update log, but we'll still have the newest 9 (for granular undo/redo? not sure)
  • If not, why not just serialize and store the full document every update? Is it just faster to only serialize the full update once every N times?

js-pkg/client/src/encryption.ts Outdated Show resolved Hide resolved
js-pkg/client/src/encryption.ts Outdated Show resolved Hide resolved
js-pkg/client/src/encryption.ts Outdated Show resolved Hide resolved
js-pkg/client/src/keystore.ts Show resolved Hide resolved
js-pkg/react/src/main.tsx Outdated Show resolved Hide resolved
js-pkg/client/src/indexeddb.ts Outdated Show resolved Hide resolved
js-pkg/client/src/indexeddb.ts Outdated Show resolved Hide resolved
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 34a2bba in 12 seconds

More details
  • Looked at 103 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:277
  • Draft comment:
    The receiveSyncMessage method was moved but not modified. Ensure that its new position is logical and consistent with the code structure.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The receiveSyncMessage and broadcastAwareness methods were moved but not modified. This is a refactor for better organization, not a functional change.
2. js-pkg/client/src/provider.ts:304
  • Draft comment:
    The broadcastAwareness method was moved but not modified. Ensure that its new position is logical and consistent with the code structure.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The broadcastAwareness method was moved but not modified. This is a refactor for better organization, not a functional change.

Workflow ID: wflow_mxtPqMit9wAHS8vw


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 6d0d748 in 31 seconds

More details
  • Looked at 87 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:6
  • Draft comment:
    Consider using the EVENT_SYNC constant instead of the hardcoded string 'sync' for consistency and maintainability.
const EVENT_SYNC = 'sync'
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces constants for message types, which is a good practice for readability and maintainability. However, the constants are not used consistently throughout the file. Specifically, the EVENT_SYNC constant is defined but not used in the emit method where the event name is hardcoded as 'sync'.
2. js-pkg/client/src/provider.ts:156
  • Draft comment:
    Consider using the EVENT_SYNC constant instead of the hardcoded string 'sync' for consistency and maintainability.
      this.emit(EVENT_SYNC, state)
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces constants for message types, which is a good practice for readability and maintainability. However, the constants are not used consistently throughout the file. Specifically, the EVENT_SYNC constant is defined but not used in the emit method where the event name is hardcoded as 'sync'.
3. js-pkg/client/src/provider.ts:272
  • Draft comment:
    Consider using the EVENT_SYNC constant instead of the hardcoded string 'sync' for consistency and maintainability.
      this.emit(EVENT_SYNC, state)
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces constants for message types, which is a good practice for readability and maintainability. However, the constants are not used consistently throughout the file. Specifically, the EVENT_SYNC constant is defined but not used in the emit method where the event name is hardcoded as 'sync'.
4. js-pkg/client/src/provider.ts:292
  • Draft comment:
    Consider using the EVENT_SYNC constant instead of the hardcoded string 'sync' for consistency and maintainability.
      this.emit(EVENT_SYNC, state)
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces constants for message types, which is a good practice for readability and maintainability. However, the constants are not used consistently throughout the file. Specifically, the EVENT_SYNC constant is defined but not used in the emit method where the event name is hardcoded as 'sync'.
5. js-pkg/client/src/provider.ts:307
  • Draft comment:
    Consider using the EVENT_SYNC constant instead of the hardcoded string 'sync' for consistency and maintainability.
      this.emit(EVENT_SYNC, state)
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces constants for message types, which is a good practice for readability and maintainability. However, the constants are not used consistently throughout the file. Specifically, the EVENT_SYNC constant is defined but not used in the emit method where the event name is hardcoded as 'sync'.
6. js-pkg/client/src/provider.ts:335
  • Draft comment:
    Consider using the EVENT_SYNC constant instead of the hardcoded string 'sync' for consistency and maintainability.
      this.emit(EVENT_SYNC, state)
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces constants for message types, which is a good practice for readability and maintainability. However, the constants are not used consistently throughout the file. Specifically, the EVENT_SYNC constant is defined but not used in the emit method where the event name is hardcoded as 'sync'.

Workflow ID: wflow_FVQ1Bb6xNTtA6KSi


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 7115067 in 9 seconds

More details
  • Looked at 21 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:435
  • Draft comment:
    Consider renaming _on to something more descriptive like addListener to clarify its purpose and avoid confusion with the on method.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in the PR modifies the _on method to handle once listeners correctly. However, the on method still directly calls _on without checking for once. This could lead to confusion or errors if on is expected to handle once listeners as well.

Workflow ID: wflow_TTJ77kyeCqrDjn4H


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 0e6794b in 26 seconds

More details
  • Looked at 37 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:357
  • Draft comment:
    Redundant connect calls when shouldConnect is true and isConnecting is false. Consider refactoring to avoid repetition. This is also present in websocketError and setStatus.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_hp5HkyMkWGs1qfWa


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 86b4557 in 22 seconds

More details
  • Looked at 63 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. examples/nextjs/src/app/(demos)/color-grid/page.tsx:9
  • Draft comment:
    Unresolved merge conflict markers (e.g., <<<<<<< HEAD, =======, >>>>>>>) are present. These should be resolved before merging.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. js-pkg/client/src/provider.ts:152
  • Draft comment:
    The indexedDBProvider is initialized but not used. Ensure it's utilized or remove it if unnecessary.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_wzA4B2IkVs7MPVjW


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 7a9770e in 19 seconds

More details
  • Looked at 28 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:361
  • Draft comment:
    The increment of this.retries should occur before calculating the timeout to ensure the backoff logic is applied correctly. This applies to line 376 as well.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_sPNrMECP3h4Nkcrj


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@paulgb paulgb requested a review from jakelazaroff December 16, 2024 21:21
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 33c39b6 in 35 seconds

More details
  • Looked at 100 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js-pkg/client/src/indexeddb.ts:96
  • Draft comment:
    Consider awaiting the loadFromDb call to ensure that the database is fully loaded before proceeding with other operations.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. js-pkg/client/src/indexeddb.ts:182
  • Draft comment:
    Clarify in the comment that null is returned if the key already exists.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The insertValue method returns null if the key already exists, but this is not clearly documented in the method's comment. The comment should explicitly mention that null is returned when the key already exists.

Workflow ID: wflow_N13kBfKclVmiFTNH


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on e2255ab in 27 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_Pc3xjLYw0thP55iP


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

js-pkg/client/src/provider.ts Outdated Show resolved Hide resolved
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 20b167b in 47 seconds

More details
  • Looked at 31 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:356
  • Draft comment:
    The backoff calculation uses DELAY_MS_BEFORE_RETRY_TOKEN_REFRESH instead of DELAY_MS_BEFORE_RECONNECT. This seems incorrect given the context of reconnecting after a failed token fetch.
        DELAY_MS_BEFORE_RECONNECT *
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. js-pkg/client/src/provider.ts:374
  • Draft comment:
    The backoff calculation uses DELAY_MS_BEFORE_RECONNECT instead of DELAY_MS_BEFORE_RETRY_TOKEN_REFRESH. This seems incorrect given the context of retrying token refresh.
          DELAY_MS_BEFORE_RETRY_TOKEN_REFRESH *
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_eYAhNEhvmXDKw0nV


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 7975284 in 24 seconds

More details
  • Looked at 66 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/provider.ts:175
  • Draft comment:
    The change from Promise<IndexedDBProvider> to IndexedDBProvider is not handled correctly. The asynchronous nature of createIndexedDBProvider is ignored, which can lead to race conditions or unhandled promise rejections. Consider using await properly or handling the promise correctly.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_EjTWgodeZssBhZp4


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on ba08aea in 43 seconds

More details
  • Looked at 148 lines of code in 10 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 drafted comments based on config settings.
1. examples/nextjs/src/app/(demos)/blocknote/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
2. examples/nextjs/src/app/(demos)/code-editor/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
3. examples/nextjs/src/app/(demos)/color-grid/page.tsx:9
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
4. examples/nextjs/src/app/(demos)/presence/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
5. examples/nextjs/src/app/(demos)/slate/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
6. examples/nextjs/src/app/(demos)/text-editor/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
7. examples/nextjs/src/app/(demos)/to-do-list/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.
8. examples/nextjs/src/app/(demos)/tree-crdt/page.tsx:8
  • Draft comment:
    Ensure that setting offlineSupport={true} is intentional for all examples, as the default is now false. This is consistent with the PR description.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions that the default value for offlineSupport should be false, and the code reflects this change. However, the usage in the examples sets offlineSupport to true. This is consistent with the intent to enable offline support in the examples.

Workflow ID: wflow_owvupRxWzFtOTOfB


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on e48fa19 in 37 seconds

More details
  • Looked at 19 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/indexeddb.ts:128
  • Draft comment:
    Wrap request.onerror in a function to ensure it is called correctly.
      request.onerror = () => reject(request.error)
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_50qivAq8u23fBLST


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

return new Promise<IDBDatabase>((resolve, reject) => {
const request = indexedDB.open(name, 4)
request.onupgradeneeded = (event: IDBVersionChangeEvent) => {
const db = (event.target! as any).result as IDBDatabase
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to use request.result here instead of (event.target! as any).result as IDBDatabase?

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on f6ec496 in 4 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js-pkg/client/src/indexeddb.ts:24
  • Draft comment:
    Consider adding error handling within the onupgradeneeded event to manage potential errors during the object store creation.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The onupgradeneeded event handler should handle errors that might occur during the creation of the object store.

Workflow ID: wflow_ZIh31zzFbvGddCvT


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@paulgb paulgb merged commit 3c63b8d into main Dec 16, 2024
7 checks passed
@paulgb paulgb deleted the paul/dis-3019-offline-support-in-provider branch December 16, 2024 23:13
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