Skip to content

feat: add guards and use spacecat-shared-utils#5

Closed
solaris007 wants to merge 2 commits intomainfrom
update-dynao-to-utils
Closed

feat: add guards and use spacecat-shared-utils#5
solaris007 wants to merge 2 commits intomainfrom
update-dynao-to-utils

Conversation

@solaris007
Copy link
Copy Markdown
Member

Have dynamo module use guards for its api. The guards now use the spacecat-shared-utils methods.

@solaris007 solaris007 added the enhancement New feature or request label Nov 28, 2023
@solaris007 solaris007 self-assigned this Nov 28, 2023
@solaris007
Copy link
Copy Markdown
Member Author

broken branch

@solaris007 solaris007 closed this Nov 28, 2023
ekremney added a commit that referenced this pull request Mar 10, 2026
…che and keepAlive

Addresses PR review items #4-#7:

- **#4 (Response cache)**: @adobe/fetch caches GET responses by default (100MB LRU).
  PostgREST and Vault GET responses would be cached, causing stale reads after
  writes. Fix: use noCache/keepAliveNoCache contexts to disable response caching.

- **#5 (Dependency weight)**: vault-secrets now imports @adobe/fetch directly
  instead of @adobe/spacecat-shared-utils, avoiding heavy transitive deps
  (cheerio, aws-xray-sdk, zod, etc.) in a security-critical package.

- **#6 (keepAlive: false)**: @adobe/fetch's default h2() context sets keepAlive: false
  for h1 on Node 19+. PostgREST is behind a plain HTTP ALB, so all requests use h1.
  Fix: data-access uses keepAliveNoCache() which forces h1 with keepAlive: true.
  Vault uses noCache() which enables h2 for HTTPS targets.

- HELIX_FETCH_FORCE_HTTP1 fallback: both packages use h1NoCache() in tests
  for nock compatibility, matching the established pattern from shared-utils.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant