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

SyncEngineLevel respects most recent startSync interval. #887

Merged
merged 6 commits into from
Sep 5, 2024

Conversation

LiranCohen
Copy link
Member

@LiranCohen LiranCohen commented Sep 4, 2024

This PR slightly modifies the way sync works.

  • startSync now does a sync operation immediately as well as setting an interval, this way you don't have to wait the entire interval.
  • calling subsequent startSync will:
    • replace the interval
    • if there is a sync already running it will not perform a sync immediately, if no sync is running it will also perform an immediate sync.
  • calling a sync performs a one-shot sync.
  • calling a sync while a sync is already in progress will throw.

Copy link

changeset-bot bot commented Sep 4, 2024

⚠️ No Changeset found

Latest commit: bb52957

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Sep 4, 2024

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 5

@web5/api

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

@web5/crypto

  • Project entry file: packages/crypto/src/index.ts
📄 File: ./packages/crypto/src/utils.ts
⚠️ extractor:typedoc:missing-docs: CryptoUtils (Variable) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomPin (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomUuid (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.randomBytes (Property) does not have any documentation.
⚠️ extractor:typedoc:missing-docs: CryptoUtils.__type.getJoseSignatureAlgorithmFromPublicKey (Property) does not have any documentation.

@web5/crypto-aws-kms

  • Project entry file: packages/crypto-aws-kms/src/index.ts

@web5/dids

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

@web5/credentials

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

TBDocs Report Updated at 2024-09-04T22:47:48Z bb52957

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.43%. Comparing base (4527444) to head (bb52957).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #887   +/-   ##
=======================================
  Coverage   93.42%   93.43%           
=======================================
  Files         117      117           
  Lines       33260    33279   +19     
  Branches     2663     2668    +5     
=======================================
+ Hits        31072    31093   +21     
+ Misses       2149     2147    -2     
  Partials       39       39           
Components Coverage Δ
agent 87.39% <93.33%> (+0.02%) ⬆️
api 99.63% <ø> (+0.02%) ⬆️
common 98.68% <ø> (ø)
credentials 94.95% <ø> (ø)
crypto 93.79% <ø> (ø)
dids 97.77% <ø> (ø)
identity-agent 96.42% <ø> (ø)
crypto-aws-kms 100.00% <ø> (ø)
proxy-agent 96.42% <ø> (ø)
user-agent 96.57% <ø> (ø)

@LiranCohen LiranCohen marked this pull request as ready for review September 4, 2024 22:34
@LiranCohen LiranCohen merged commit da3630a into main Sep 5, 2024
35 checks passed
@LiranCohen LiranCohen deleted the lirancohen/start-sync-race branch September 5, 2024 00:58
LiranCohen added a commit that referenced this pull request Sep 5, 2024
LiranCohen added a commit that referenced this pull request Sep 6, 2024
- Add a missing changset for #887:

`stopSync` now blocks if a current sync is in progress before clearing the interval. An optional timeout can be defined, the default is 2 seconds. After this timeout it will throw.

TestHarness has been updated to stop sync before clearing storage, previously this caused an issue where an ongoing sync would attempt to sign messages for DID that no longer had keys after clearing storage.

#890 has been created to better address this by creating a signal to gracefully stop sync immediately.
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