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

Incorrect MessageOptions for RecordsRead requests in sync manager. #297

Merged
merged 3 commits into from
Nov 18, 2023

Conversation

LiranCohen
Copy link
Member

When the sync-manager issued a RecordsRead it was not updated to use the filter property that was added.
I'll create a separate issue for dwn-sdk-js to handle this error and return a proper response.

This addresses #294

The reason this would happen in those scenarios, after updating the initial RecordsWrite message is retained, but the data is deleted (including the encodedData).

This error would happen during a pull where the client is pulling down messages associated with a record that's been updated, when they reach the initial write, doesn't find it locally, and then does a RecordsRead to fetch it, it failed by not providing a filter.

It could also happen in other cases when using the sendRequest method from DwnManager.

Both of the cases are handled by the tests I added, but I'd like to add some more comprehensive scenario testing. Although I think some of that would be better suited for the api package as that's how those scenarios would be called.

Copy link

codesandbox bot commented Nov 17, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

github-actions bot commented Nov 17, 2023

TBDocs Report

✅ No errors or warnings

@web5/api

  • Project entry file: packages/api/src/index.ts

Updated @ 2023-11-18T14:59:36.687Z - Commit: 1798193

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Merging #297 (aae47db) into main (50c27ec) will increase coverage by 0.28%.
The diff coverage is 94.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #297      +/-   ##
==========================================
+ Coverage   90.41%   90.70%   +0.28%     
==========================================
  Files          74       74              
  Lines       14068    14075       +7     
  Branches     1379     1384       +5     
==========================================
+ Hits        12720    12767      +47     
+ Misses       1322     1282      -40     
  Partials       26       26              
Components Coverage Δ
api 95.64% <ø> (ø)
common 95.00% <ø> (ø)
credentials 94.49% <ø> (ø)
crypto 100.00% <ø> (ø)
dids 88.75% <ø> (ø)
agent 88.07% <94.73%> (+0.85%) ⬆️
identity-agent 56.81% <ø> (ø)
proxy-agent 58.43% <ø> (ø)
user-agent 55.22% <ø> (ø)

@frankhinek frankhinek linked an issue Nov 18, 2023 that may be closed by this pull request
@frankhinek frankhinek added the bug Something isn't working label Nov 18, 2023
@frankhinek frankhinek force-pushed the lirancohen/sync-error-get-dwn-message branch from 2ecbc7b to aae47db Compare November 18, 2023 14:57
@frankhinek frankhinek merged commit 9655934 into main Nov 18, 2023
26 of 27 checks passed
@frankhinek frankhinek deleted the lirancohen/sync-error-get-dwn-message branch November 18, 2023 15:13
finn-block pushed a commit that referenced this pull request Mar 19, 2024
…297)

* add filter property for RecordsRead within sync manager
* Fix response type for RecordsRead messages and improve type safety

---------


Co-authored-by: Frank Hinek <[email protected]>
finn-block pushed a commit that referenced this pull request Mar 19, 2024
…297)

* add filter property for RecordsRead within sync manager
* Fix response type for RecordsRead messages and improve type safety

---------


Co-authored-by: Frank Hinek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sync error: Cannot read properties of undefined (reading 'protocol')
3 participants