Skip to content

feat: Deprecate identity retrieval#1876

Merged
LautaroPetaccio merged 8 commits intomainfrom
feat/deprecate-identity-retrieval
Mar 17, 2026
Merged

feat: Deprecate identity retrieval#1876
LautaroPetaccio merged 8 commits intomainfrom
feat/deprecate-identity-retrieval

Conversation

@LautaroPetaccio
Copy link
Contributor

Removes the catalyst identity resolution mechanism and replaces the ContentCluster class with a focused WKC-style component that only handles DAO server synchronization.

Why

The content server had a startup-time identity resolution flow (determineCatalystIdentity) that attempted to figure out whether this catalyst was registered in the DAO. It did so by calling its own /challenge endpoint up to 10 times with 2-5s intervals, which could block startup for over 20 seconds — especially when the reverse proxy (NGINX, Cloudflare) wasn't ready yet.

After analysis, the identity result (getIdentity()) was never consumed by any production code path. The only things that mattered from ContentCluster were:

  • getAllServersInCluster() — used by synchronization and failed deployment retries
  • onSyncFinished() — triggers re-sync when the server list changes
  • getStatus() — exposed on the /status endpoint

All of these rely on getContentServersFromDao(), which filters servers using the CONTENT_SERVER_ADDRESS env var — completely independent of identity resolution. The IdentityProvider interface, getIdentity(), determineCatalystIdentity(), getChallengeInServer(), and the challengeSupervisor dependency (for identity purposes) were dead code.

How

Replaced ContentCluster class with a WKC factory component

The old ContentCluster class (service/synchronization/ContentCluster.ts) was replaced with a createContentCluster factory function following the well-known-components pattern used throughout the codebase. The new component lives in logic/cluster/ with a proper module structure:

  • component.ts — the factory function and implementation
  • types.ts — the IContentClusterComponent interface
  • index.ts — barrel exports

The new component keeps the exact same DAO sync behavior (periodic polling, server add/remove detection, shuffle, callbacks) but drops all identity-related code.

Removed dead code

  • content/src/logic/cluster-helpers.ts — contained determineCatalystIdentity, getChallengeInServer, and normalizeContentBaseUrl. The first two were identity-only; normalizeContentBaseUrl was inlined into the new component.
  • content/src/service/synchronization/ContentCluster.ts — the old class with IdentityProvider interface, getIdentity(), identityFuture, and challengeSupervisor dependency.
  • content/test/helpers/service/synchronization/MockedContentCluster.ts — only mocked getIdentity(), which nothing consumed.
  • content/test/unit/service/synchronization/ContentCluster.spec.ts — old tests focused on identity resolution.

Copy link
Contributor

@aleortega aleortega left a comment

Choose a reason for hiding this comment

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

LGTM

@LautaroPetaccio LautaroPetaccio merged commit 1de90f9 into main Mar 17, 2026
5 checks passed
@LautaroPetaccio LautaroPetaccio deleted the feat/deprecate-identity-retrieval branch March 17, 2026 12:58
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.

2 participants