Skip to content

fix(e2e): adapt E2E tests to EdgeAgent seed callback API - #238

Merged
patextreme merged 2 commits into
mainfrom
fix/e2e-seed-callback
Jun 17, 2026
Merged

fix(e2e): adapt E2E tests to EdgeAgent seed callback API#238
patextreme merged 2 commits into
mainfrom
fix/e2e-seed-callback

Conversation

@patextreme

Copy link
Copy Markdown
Contributor

Problem

feat(agent): init now receives a seed callback (#233, commit a4cd164, shipped in 8.1.0) changed EdgeAgent.seed from a Seed value to an async closure, and updated the seed: initializer parameter from Seed? to (() async throws -> Seed)?:

public let seed: () async throws -> Seed          // was: public let seed: Seed
public init(..., seed: (() async throws -> Seed)? = nil)  // was: seed: Seed? = nil

The SDK unit tests (BackupWalletTests, PrismOnboardingInvitationTests) were updated in that same commit, but the E2E tests were not. As a result the e2e test target no longer compiles against the 8.x SDK:

DidcommAgentAbility.swift:100:19: error: cannot convert value of type 'Seed'
  to expected argument type '(() async throws -> Seed)?'

xcodebuild build-for-testing fails (** TEST BUILD FAILED **), so no E2E tests can run. This was surfaced by an integration run against the locally-hosted Identus stack (integration run #27693263471).

Solution

Update the three E2E sites that consume the seed to mirror the pattern already used by the unit tests (e.g. BackupWalletTests):

  • DidcommAgentAbility.swift — pass a () async throws -> Seed closure to EdgeAgent's initializer. A local let seed = seed value copy is bound before the init so the escaping closure captures the value (not self), which both satisfies Swift's explicit-capture requirement and avoids a retain cycle.
  • EdgeAgentWorkflow.swift — call try await edgeAgent.seed() instead of reading edgeAgent.seed directly (two sites: the prism/jwt credential-offer path and the createBackup path).
-            seed: seed
+            let seed = seed
+            ...
+            seed: { seed }
-            let seed = sdk.didcommAgent.edgeAgent.seed
+            let seed = try await sdk.didcommAgent.edgeAgent.seed()

No SDK public API or behavior is changed — this is a test-only fix.

Verification

Pointed the integration local-tunnel E2E suite at this branch and ran it to green. Verified suite: ** TEST EXECUTE SUCCEEDED ** — 23 tests executed, 0 failures (2 skipped).

Alternatives Considered

None. This follows the exact pattern the SDK's own unit tests adopted for the same breaking change, so the E2E tests stay consistent with the rest of the suite.

Checklist

  • My PR follows the contribution guidelines of this project
  • My PR is free of third-party dependencies that don't comply with the Allowlist
  • 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
  • I have checked the PR title to follow the conventional commit specification

@patextreme
patextreme requested a review from a team as a code owner June 17, 2026 15:11
@patextreme
patextreme force-pushed the fix/e2e-seed-callback branch from ff2a455 to 1243a88 Compare June 17, 2026 15:15
The EdgeAgent seed was changed from a Seed value to an async closure
(() async throws -> Seed)? in a4cd164 (shipped in 8.1.0), which updated
the unit tests but not the E2E tests, breaking the E2E build:

  DidcommAgentAbility.swift:100: error: cannot convert value of type
  'Seed' to expected argument type '(() async throws -> Seed)?'

Update the three affected E2E sites to mirror the unit-test pattern:
  - DidcommAgentAbility: pass { seed } closure to EdgeAgent init
  - EdgeAgentWorkflow: call try await edgeAgent.seed() (x2)

Signed-off-by: Pat Losoponkul <patextreme@hotmail.com>
8.1.1-rc.1 passed { seed } to EdgeAgent's escaping (() async throws -> Seed)?
seed closure, but Swift requires explicit capture semantics for the implicit
self.seed reference:

  DidcommAgentAbility.swift:100:21: error: reference to property 'seed' in
  closure requires explicit use of 'self' to make capture semantics explicit

Mirror the unit-test pattern (BackupWalletTests in a4cd164): bind a local
'let seed = seed' value copy before the init so the closure captures the
value rather than self (also avoids a retain cycle).

Signed-off-by: Pat Losoponkul <patextreme@hotmail.com>
@patextreme
patextreme force-pushed the fix/e2e-seed-callback branch from 1243a88 to a658565 Compare June 17, 2026 15:22
@sonarqubecloud

Copy link
Copy Markdown

@patextreme
patextreme merged commit ebbfdb6 into main Jun 17, 2026
12 checks passed
@patextreme
patextreme deleted the fix/e2e-seed-callback branch June 17, 2026 15:43
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.

1 participant