Skip to content

chore(directus-client): reduce refresh coordinator internal API surface #287

Description

@remihuigen

Context

Follow-up cleanup from #280.

The refresh coordinator currently re-exports several timing constants and helpers from refresh-coordinator/index.ts, even though they are implementation details used only by the coordinator internals/tests.

This is not a correctness issue and does not need to block #280. We can handle it separately to keep the coordinator surface small and easier to reason about.

Proposed cleanup

  • Stop re-exporting coordinator-internal timing values/helpers from refresh-coordinator/index.ts unless they are genuinely needed outside the coordinator implementation.
  • Keep REFRESH_STORAGE_MOUNT internal if no external caller needs it.
  • Rename the generic REFRESH_RESULT_TTL_SECONDS constant to something explicit such as REFRESH_TERMINAL_RESULT_TTL_SECONDS, since completed results now use a separate 30-second TTL and the 5-second value applies specifically to terminal failures.
  • Keep the runtime behavior unchanged.

Current intended TTL semantics remain:

completed refresh: 30s
terminal failure:  5s
transient failure: 1s
Redis lease:       30s

Goal

Reduce unnecessary API-shaped surface and make the remaining names describe their actual semantics. Prefer the smallest possible diff; do not introduce new abstractions or redesign the coordinator.

Acceptance criteria

  • Coordinator internals are not unnecessarily re-exported from index.ts.
  • The 5-second terminal-result TTL has an explicit name.
  • No refresh coordination behavior changes.
  • Existing coordinator/auth tests continue to pass.

Related: #280

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions