TBD54566975 / web5-js

Monorepo for the Web5 JS TypeScript implementation
https://tbd54566975.github.io/web5-js/
Apache License 2.0
129 stars 52 forks source link

Modify `stopSync` to block if sync is currently active #889

Closed LiranCohen closed 3 weeks ago

LiranCohen commented 3 weeks ago

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.

https://github.com/TBD54566975/web5-js/issues/890 has been created to better address this by creating a signal to gracefully stop sync immediately.

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 1a31231d37d06e76f7d300ceb12151b869a57739

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | -------------------- | ----- | | @web5/agent | Patch | | @web5/identity-agent | Patch | | @web5/proxy-agent | Patch | | @web5/user-agent | Patch | | @web5/api | Patch |

Not sure what this means? Click here to learn what changesets are.

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

github-actions[bot] commented 3 weeks ago

TBDocs Report

🛑 Errors: 0 ⚠️ Warnings: 5

@web5/api

@web5/crypto

📄 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

@web5/dids

@web5/credentials


TBDocs Report Updated at 2024-09-06T18:36:26Z 1a31231

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #889 +/- ## ======================================= Coverage 93.43% 93.43% ======================================= Files 117 117 Lines 33279 33297 +18 Branches 2668 2673 +5 ======================================= + Hits 31093 31112 +19 + Misses 2147 2146 -1 Partials 39 39 ``` | [Components](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | Coverage Δ | | |---|---|---| | [agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `87.43% <100.00%> (+0.03%)` | :arrow_up: | | [api](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `99.60% <ø> (-0.03%)` | :arrow_down: | | [common](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `98.68% <ø> (ø)` | | | [credentials](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `94.95% <ø> (ø)` | | | [crypto](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `93.79% <ø> (ø)` | | | [dids](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `97.77% <ø> (ø)` | | | [identity-agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `96.42% <ø> (ø)` | | | [crypto-aws-kms](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `100.00% <ø> (ø)` | | | [proxy-agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `96.42% <ø> (ø)` | | | [user-agent](https://app.codecov.io/gh/TBD54566975/web5-js/pull/889/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TBD54566975) | `96.57% <ø> (ø)` | |