Skip to content

Fix/server version endpoint - #117

Open
khalsz wants to merge 7 commits into
iterorganization:developfrom
khalsz:fix/server-version-endpoint
Open

Fix/server version endpoint#117
khalsz wants to merge 7 commits into
iterorganization:developfrom
khalsz:fix/server-version-endpoint

Conversation

@khalsz

@khalsz khalsz commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@olivhoenen
olivhoenen requested a review from jholloc August 11, 2026 08:53
@olivhoenen

olivhoenen commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Thanks @khalsz, it looks good and makes sense to me, but we still need to address backward compatibility somehow. See below the behavior with a CLI client based on this PR and our production server based on 0.15.1 (same with dev):

(venv) [hoeneno@98dci4-srv-1001 SimDB]$ (fix/server-version-endpoint) simdb remote test 
Error: 'server_version'

We will need to have a strategy there, hereafter are some thoughts from copilot:

Suggested fixes

  1. Make get_server_version() tolerant: try the new root endpoint first, and if
    server_version is missing or the request fails, fall back to the versioned root
    (self.get("", authenticate=False)); use .get("server_version") instead of
    [...] so a missing key degrades gracefully (e.g., returns None/"unknown")
    instead of raising.
  2. Alternatively, keep server_version in both locations on the server for one
    deprecation cycle before removing it from the versioned index.
  3. Add an integration test that builds a server response missing server_version at
    one of the two locations and asserts RemoteAPI construction still succeeds —
    current tests mock get_server_version/get_api_version directly, or use a Flask
    test client that's always fully up to date on both sides, so they don't catch
    this cross-version scenario.

Other notes

Dropping the extra get_api_version() round-trip in favor of the already-negotiated
selected_version string looks safe and backward compatible — selected_version was
already validated by select_api_version() against the server's advertised
endpoints.

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