test(e2e): cover watching against soulfind, and read the reply as written
The e2e job proved nothing about watching: it passed because the suite has no test that exercises it. Two now run against a real soulfind. - a watch reply carries status and share statistics in one message, checked against a subject sharing a known two files, and unwatching drops both the watch and the snapshot - a username the server does not know is answered with an absence flag and must not stay in the watch list Also reads the two obsolete fields of the reply as the two 32-bit values the server writes, matching soulfind and the sibling GetUserStats (36) handler. The byte count is identical, so this is not a behaviour change -- but the handler now says what the wire actually carries.
This commit is contained in:
@@ -31,7 +31,12 @@ impl MessageHandler<ServerMessage> for WatchUserHandler {
|
||||
let watched = if exists {
|
||||
let status = message.read_int32();
|
||||
let average_speed = message.read_int32();
|
||||
let _upload_number = message.read_int64(); // obsolete
|
||||
// Two obsolete 32-bit fields, exactly as GetUserStats (36)
|
||||
// carries them -- not one 64-bit value. The byte count is the
|
||||
// same either way, but reading them as the server writes them
|
||||
// keeps this handler and its sibling honest.
|
||||
let _upload_number = message.read_int32(); // obsolete, always 0
|
||||
let _unknown = message.read_int32(); // obsolete, always 0
|
||||
let shared_files = message.read_int32();
|
||||
let shared_folders = message.read_int32();
|
||||
ServerMessage::WatchedUserReceived {
|
||||
@@ -71,7 +76,8 @@ mod tests {
|
||||
.write_int8(1) // exists
|
||||
.write_int32(2) // status: online
|
||||
.write_int32(1024) // average speed
|
||||
.write_int64(0) // obsolete upload number
|
||||
.write_int32(0) // obsolete upload number
|
||||
.write_int32(0) // obsolete unknown
|
||||
.write_int32(4321) // shared files
|
||||
.write_int32(77); // shared folders
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user