Messages sent by client should differentiate between server-api and client-api

Bug #511149 reported by Free Ekanayaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Medium
Free Ekanayaka

Bug Description

On the server side we already differentiate between the "server-api" and
the "client-api" fields in the message payloads posted by the
client. The "server-api" field is used by the message system to lookup
the correct MessageAPI adapter (and hence message handlers) for that
particular server API version, and the "client-api" ends up in the
Computer.current_api attribute for the exchanging computer.

On the client side however, we just have one single API version defined
in landscape/__init__.py that we use to set both the "server-api" and
"client-api" fields.

We should split the API variable in SERVER_API and CLIENT_API, so we can
let the two APIs evolve independently. Basically the schema of the
messages *sent* by the client is implicitly defined by the SERVER_API
version, while the schema of the messages *accepted* by the client by
the CLIENT_API one.

One known problem is that if a client sets a SERVER_API version newer
than the latest SERVER_API version that the server is prepared to accept
(for example the latest landscape-client used with an oldish
standalone), it will get a 404 not-found error back. In that case the
client should probably be able to decrease the SERVER_API its sending
and cope with that. However this deserves another bug.

 affects landscape-client
 status inprogress
 importance medium
 assignee free.ekanayaka
 milestone 1.3.4

Related branches

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Note that I set the CLIENT_API to 3.3, because marks 3.3 the point since the client accepts the "binaries" field in the "change-packages". The server will have to check if Computer.current_api is greater or equal than 3.3 when deciding whether to send "change-packages" messages containing the "binaries" field (like for applying package profiles).

tags: added: fix-it-friday
Changed in landscape-client:
status: In Progress → Fix Committed
David Britton (dpb)
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.