Skip to content

fix: prevent panic on IOTA connection failure via lazy initialization#44

Merged
nanderstabel merged 4 commits intobetafrom
fix/lazy-handler
Mar 3, 2026
Merged

fix: prevent panic on IOTA connection failure via lazy initialization#44
nanderstabel merged 4 commits intobetafrom
fix/lazy-handler

Conversation

@nanderstabel
Copy link
Copy Markdown
Contributor

@nanderstabel nanderstabel commented Mar 2, 2026

Description of change

Restructures the Resolver to initialize IOTA network clients lazily instead of eagerly at startup.

Changes:

  • Updated Resolver to use RwLock and double-checked locking for on-demand initialization.
    • Split iota_clients into a single-network get_iota_client helper. (ensures that one failing IOTA network (client) does not affect initialization of the other IOTA network client initialization)
    • Basic handlers (JWK, Key, Web) are now always available immediately.
    • Fixed an issue where IOTA connection failures could block non-IOTA DID resolution.
  • Benefits:
    • Faster startup for non-IOTA use cases.
    • Improved resilience: unrelated IOTA errors no longer affect other DID methods.

Links to any relevant issues

Resolver::new panicking on startup in identity-wallet and ssi-agent.

How the change has been tested

Added unit tests:

  • concurrent_resolutions_do_not_deadlock
  • iota_failure_does_not_break_basic_resolver

Tested startup 'manually' in identity-wallet and ssi-agent.

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@nanderstabel nanderstabel changed the title refactor: enhance IOTA resolver with configurable client initializati… refactor: lazy initialize IOTA resolver clients Mar 3, 2026
@nanderstabel nanderstabel self-assigned this Mar 3, 2026
@nanderstabel nanderstabel added the Enhancement New feature or improvement to an existing feature label Mar 3, 2026
@nanderstabel nanderstabel changed the title refactor: lazy initialize IOTA resolver clients Fix: prevent startup panic on IOTA connection failure via lazy initialization Mar 3, 2026
@nanderstabel nanderstabel changed the title Fix: prevent startup panic on IOTA connection failure via lazy initialization fix: prevent startup panic on IOTA connection failure via lazy initialization Mar 3, 2026
@nanderstabel nanderstabel added Bug Something isn't working and removed Enhancement New feature or improvement to an existing feature labels Mar 3, 2026
@nanderstabel nanderstabel changed the title fix: prevent startup panic on IOTA connection failure via lazy initialization fix: prevent panic on IOTA connection failure via lazy initialization Mar 3, 2026
@nanderstabel nanderstabel marked this pull request as ready for review March 3, 2026 09:00
daniel-mader
daniel-mader previously approved these changes Mar 3, 2026
@nanderstabel nanderstabel merged commit 7763b58 into beta Mar 3, 2026
3 checks passed
@nanderstabel nanderstabel deleted the fix/lazy-handler branch March 3, 2026 10:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

🎉 This PR is included in version 1.0.0-beta.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working released on @beta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants