Introduce client_message_id on the server.

We are deprecating local_id/local_message_id on the Python server.
Instead of the server knowing about the client's implementation of
local id, with the message id = 9999.01 scheme, we just send the
server an opaque id to send back to us.

This commit changes the name from local_id -> client_message_id,
but it doesn't change the actual values passed yet.

The goal for client_key in future commits will be to:
    * Have it for all messages, not just locally rendered messages
    * Not have it overlap with server-side message ids.

The history behind local_id having numbers like 9999.01 is that
they are actually interim message ids and the numerical value is
used for rendering the message list when we do client-side rendering.
This commit is contained in:
Steve Howell
2017-07-12 18:16:22 -04:00
committed by showell
parent bab96ab8a0
commit 8fbb55df85
10 changed files with 40 additions and 27 deletions

View File

@@ -302,6 +302,13 @@ exports.send_message_success = function (local_id, message_id, start_time, local
};
exports.transmit_message = function (request, success, error) {
// Give the server our local_id as client_message_id. We
// will eventually decouple these concepts, so that local_id
// is only an interim value for a message id, whereas
// client_message_id will be a key used to track the message through
// its lifecycle of being posted/received/acked/sent/displayed.
request.client_message_id = request.local_id;
delete exports.send_times_data[request.id];
if (page_params.use_websockets) {
send_message_socket(request, success, error);