Skip to content

Namespace cache key collisions when colon is present #15

@foreverest

Description

@foreverest

Summary

Cache keys are currently built by joining parts with a colon. When namespace and or idempotencyKey contain a colon, different logical inputs can map to the same Redis key.

Current behavior

Cache key format:

  • without namespace: idempotent-executor-result:
  • with namespace: idempotent-executor-result::

This can collide. Example:

  • namespace = a, idempotencyKey = b:c
  • namespace = a:b, idempotencyKey = c

Both map to idempotent-executor-result:a:b:c.

Impact

  • Cross-namespace cache pollution.
  • Wrong value or error replay for logically different operations.

Temporary mitigation

Avoid using colon in both namespace and idempotencyKey.

Proposed fix

Adopt an unambiguous cache key encoding strategy (for example, typed segments and or per segment encoding) and add regression tests for delimiter cases.

Acceptance criteria

  • No collisions for any namespace plus idempotencyKey combinations.
  • Backward compatibility strategy for existing cache entries is defined and tested.
  • Tests cover delimiter-heavy inputs and mixed namespaced and non-namespaced usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions