[fractal/574-empty-next-batch: 19/19] API: handle empty `next_batch` fields



commit 350675774b2efc52a5b7b0d95ee949356f86076d
Author: Alexandre Franke <afranke gnome org>
Date:   Sat Jan 25 12:20:19 2020 +0100

    API: handle empty `next_batch` fields
    
    Fixes #574

 fractal-matrix-api/src/r0/sync/sync_events.rs | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/fractal-matrix-api/src/r0/sync/sync_events.rs b/fractal-matrix-api/src/r0/sync/sync_events.rs
index 95bae1ac..87d5a188 100644
--- a/fractal-matrix-api/src/r0/sync/sync_events.rs
+++ b/fractal-matrix-api/src/r0/sync/sync_events.rs
@@ -68,6 +68,8 @@ impl MarkPresence {
 
 #[derive(Clone, Debug, Deserialize)]
 pub struct Response {
+    // Sometimes servers don’t send this field even though it is required in the spec
+    #[serde(default)]
     pub next_batch: String,
     #[serde(default)]
     pub rooms: Rooms,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]