Skip to content

Conversation

matthiasgeihs
Copy link
Contributor

@matthiasgeihs matthiasgeihs commented Oct 7, 2025

Explanation

Currently the Shield Controller calls the /init endpoint every time a coverage request is made.
This PR implements an optimization where the /init endpoint is skipped if the coverage Id is already available.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Coverage checks now accept a request object with optional coverageId to skip /init; controller, backend, types, tests, and changelog updated accordingly.

  • Breaking API:
    • Update ShieldBackend to accept request objects: checkCoverage({ txMeta, coverageId? }), checkSignatureCoverage({ signatureRequest, coverageId? }) with new types CheckCoverageRequest and CheckSignatureCoverageRequest.
    • CHANGELOG.md: note breaking change for checkCoverage.
  • Backend (src/backend.ts):
    • ShieldRemoteBackend skips v1/*/coverage/init when coverageId is provided; otherwise performs init then polls result.
  • Controller (src/ShieldController.ts):
    • Pass latest stored coverageId via #getLatestCoverageId to checkCoverage and checkSignatureCoverage to enable init-skip.
  • Tests/Utils:
    • Update expectations to new call shape and add setupCoverageResultReceived helper; adjust simulation flow and mocks (e.g., MOCK_COVERAGE_ID).

Written by Cursor Bugbot for commit d24e5e6. This will update automatically on new commits. Configure here.

@matthiasgeihs matthiasgeihs marked this pull request as ready for review October 7, 2025 16:21
@matthiasgeihs matthiasgeihs requested review from a team as code owners October 7, 2025 16:21
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