Skip to content

feat: Implement client version handling and update error management - #738

Merged
jzunigax2 merged 4 commits into
mainfrom
feat/client-version-unsupported
Nov 6, 2026
Merged

jzunigax2 merged 4 commits into
mainfrom
feat/client-version-unsupported

Conversation

@jzunigax2

@jzunigax2 jzunigax2 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What

The CLI now handles the backend's client-version block (errorCode: CLIENT_VERSION_UNSUPPORTED) in commands, WebDAV and the browser login. Blocked users get clear update instructions instead of a raw 403.

Why

The backend (internxt/drive-server-wip#1270) can now reject outdated clients. Without this, CLI users see Request failed with status code 403, WebDAV returns confusing errors, and a blocked token refresh deletes the saved login.

How

  • Detection: the block is recognised only by errorCode: CLIENT_VERSION_UNSUPPORTED in the response body, never by the HTTP status.
  • Commands: print the backend message, the installed version and the update command (npm or docker pull), then exit 1.
  • Session: a blocked token refresh no longer deletes the saved login.
  • Login: the API error is no longer lost during login-legacy. A blocked browser login redirects to /auth-link-error?reason=CLIENT_VERSION_UNSUPPORTED.
  • WebDAV: the first block is logged once. After that, requests get a 403 with the update message without calling the API, and the server checks the API again every 5 minutes.
  • Docker: the keepalive loop logs the block once and stops trying to re-authenticate.

- Added a new middleware to handle client version checks and block requests if the CLI version is unsupported.
- Introduced `ClientVersionUnsupportedError` to manage version-related errors.
- Updated error handling to provide user-friendly messages when the CLI version is blocked.
- Enhanced the `catchError` utility to differentiate between regular errors and version-related errors.
- Modified various services and commands to integrate version checks and handle errors appropriately.
- Added tests to ensure correct behavior when the CLI version is unsupported.

This update improves the user experience by guiding users to update their CLI version when necessary.
- Updated `AuthService` to throw specific errors for unsupported client versions during security detail requests.
- Modified `UniversalLinkService` to append a reason to the error page URL when login is blocked due to client version issues.
- Added tests to verify correct behavior when handling unsupported client versions in both `AuthService` and `UniversalLinkService`.

These changes improve error reporting and user guidance for CLI version compatibility.
@jzunigax2 jzunigax2 self-assigned this Nov 5, 2026
@jzunigax2 jzunigax2 added the enhancement New feature or request label Nov 5, 2026
@jzunigax2
jzunigax2 marked this pull request as ready for review November 5, 2026 14:41
@jzunigax2
jzunigax2 requested a review from larryrider as a code owner November 5, 2026 14:41
Comment thread docker/entrypoint.sh Resolved
Comment thread docker/entrypoint.sh Resolved
- Added relogin functionality to handle session expiration more gracefully.
- Enhanced error handling for unsupported client versions with clearer messaging.
- Introduced new functions to manage version checks and auto-healing behavior.
- Improved logging for WebDAV server status and re-enablement attempts.

These changes enhance the robustness of the keepalive mechanism and provide better user feedback during session management.
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@jzunigax2
jzunigax2 merged commit 8dc4b5c into main Nov 6, 2026
9 checks passed
@jzunigax2
jzunigax2 deleted the feat/client-version-unsupported branch November 6, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants