Skip to content

feat(factory): make negative-cache TTL configurable via ConduitConfig (closes #602) - #684

Open
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-602-configurable-negative-cache-ttl
Open

feat(factory): make negative-cache TTL configurable via ConduitConfig (closes #602)#684
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-602-configurable-negative-cache-ttl

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary

Exposes the FactoryModule negative address cache TTL as a configurable property on ConduitConfig (negativeAddressCacheTtlMs), defaulting to 30,000ms (30s). Dashboards that poll at different rates can now accelerate cache eviction or disable caching entirely (closes #602).

Key Changes

  • src/types/index.ts:
    • Added optional negativeAddressCacheTtlMs?: number to ConduitConfig interface.
  • src/factory.ts:
    • Exported DEFAULT_NEGATIVE_ADDRESS_CACHE_TTL_MS = 30_000.
    • FactoryModule now reads config.negativeAddressCacheTtlMs, falling back to DEFAULT_NEGATIVE_ADDRESS_CACHE_TTL_MS.
    • Negative cache expiration timestamps are now computed via Date.now() + this.negativeAddressCacheTtlMs.
  • src/index.ts:
    • Re-exported FactoryModule and DEFAULT_NEGATIVE_ADDRESS_CACHE_TTL_MS from root entry point.
  • src/tests/factory.test.ts:
    • Added tests confirming custom TTL expiration behavior (30ms TTL auto-expires and re-resolves) and immediate 0ms TTL re-querying.
  • README.md:
    • Documented negativeAddressCacheTtlMs in the ConduitConfig Reference table.

Verification

  • npx vitest run src/tests/factory.test.ts: 21/21 tests passing.
  • Full test suite: 81/81 active test suites passing (1,023 tests passed, 0 failures).

Copilot AI lite review requested due to automatic review settings September 5, 2026 23:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Make FactoryModule negative-cache TTL configurable

2 participants