Skip to content

Fetch the cloud service's keys and properties once, not for every request - #48

Closed
jwrosewell wants to merge 2 commits into
fix/element-default-accepts-no-evidencefrom
fix/cloud-keys-fetched-once
Closed

jwrosewell wants to merge 2 commits into
fix/element-default-accepts-no-evidencefrom
fix/cloud-keys-fetched-once

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #46.

Problem

The cloud request engine fetched the cloud service's evidence keys and accessible properties again for every request, instead of once.

  • keysAndPropertiesFetched tested this.evidenceKeyFilter.length > 0 (cloudRequestEngine.js line 119). An evidence key filter has no length, so the test was always false.
  • ready() fetches whenever that test is false (lines 159 to 168), and every cloud engine calls ready() when it processes (cloudEngine.js line 117).
  • So each request made a request to evidencekeys and one to accessibleProperties before the request it was meant to make.

Change

cloudRequestEngine.js: getEvidenceKeys records evidenceKeysFetched when the keys arrive, and keysAndPropertiesFetched tests that with the properties, so the keys and properties are fetched once.

How to verify

A new test, the keys and properties are not fetched again for a later request in tests/cloudRequestEngine.test.js, counts the stand-in client's requests across two processed requests in a Pipeline with a cloud engine. Both runs used a temporary workflow on Ubuntu with Node 20, running tests/cloudRequestEngine.test.js and tests/cloudEngine.test.js.

  1. Red, the test alone (6c53452, run 42506954364). The second request made two more requests.
    ● the keys and properties are not fetched again for a later request
      Expected: 2
      Received: 4
    Tests:       1 failed, 23 passed, 24 total
    
  2. Green, the change (2d6cba6, run 42506953821). All 24 passed.
  3. Full build. common-ci's nightly-pull-request.yml, run as a dry run from a temporary branch, built 2d6cba6, this branch's head, merged with rc (run 42507610109). All eight build and test jobs passed on the second attempt. The first attempt failed only in macOS_Node_22, where the cloud TAC lookup and native model lookup example tests ran past jest's 10 second limit waiting for the cloud service. Both passed in the other seven jobs, and in the rerun.

Release note

The cloud request engine now fetches the cloud service's evidence keys and accessible properties once, rather than before every request, so each request makes one call to the cloud service.

What remains

@jwrosewell

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #73 (75d56b0), which fetches the cloud service keys and properties once.

@jwrosewell jwrosewell closed this Nov 13, 2026
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