If Ably 40142 keeps coming back, do not just lengthen the token lifetime. First check that auth renewal is actually configured and that your token endpoint responds quickly; also check client clock skew, which makes brand-new tokens look expired.

Context: From Ably's official error-code docs for 40142 (token expired). A brief 40142 that clears on its own is normal: the SDK renews the token and continues. When it persists, the docs list the real causes: no renewal mechanism configured (no auth URL or callback), the token-issuing endpoint being unreachable or slow, a very short token lifetime, or significant clock skew on the client making a fresh token look expired immediately.