Aller au contenu
Français

MemberStatus

Ce contenu n’est pas encore disponible dans votre langue.

MemberStatus = typeof MEMBER_STATUSES[number]

Defined in: src/cluster/Protocol.ts:49

The type is derived from MEMBER_STATUSES rather than declared alongside it. A status arrives off the wire as an arbitrary string, so the runtime needs a list to check it against — and a hand-maintained second copy of the same seven names is exactly the kind of thing that drifts. Here a new status cannot be added to one without the other.

Why it needs checking at all: Cluster.emitStatusTransition dispatches on this value with match(...).exhaustive(), which throws for anything outside the union — and it runs after the member has been written to the map, so an unchecked status both crashed the node and was re-gossiped to its peers (#563).