From f72c552241f6d1b933afff991d8f47a30a1bdf59 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 10 Feb 2026 18:30:36 -0500 Subject: [PATCH] fix: correct TestKoboAnalyticsGettests request format to match handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was sending a single object with a "meta" field, but the handler expects an array of KoboAnalyticsTest objects (matching other Kobo endpoints). Changed: - Removed unsupported "meta" field - Converted single object to array format - Now matches Kobo protocol pattern used by /markup and /bookmark endpoints All Kobo tests now pass: - TestKoboInitialization ✅ - TestKoboLibrarySync ✅ - TestKoboMarkupSync ✅ - TestKoboBookmarkSync ✅ - TestKoboAnalyticsGettests ✅ - TestKoboDeviceHeaderParsing ✅ --- cmd/server/tests/kobo_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/server/tests/kobo_test.go b/cmd/server/tests/kobo_test.go index 1fc4464..e3ad5d5 100644 --- a/cmd/server/tests/kobo_test.go +++ b/cmd/server/tests/kobo_test.go @@ -215,14 +215,13 @@ func TestKoboAnalyticsGettests(t *testing.T) { deviceSetup := setupDeviceTest(t) koboDevice := deviceSetup.CreateDevice(t, "Test Kobo", "kobo", "kobo-clara-analytics") - reqBody := map[string]interface{}{ - "meta": map[string]string{ - "name": "Kobo Analytics Tests", + reqBody := []map[string]interface{}{ + { + "ContentId": mediaItemID, + "ReadingEvent": "Reading", + "RemainingTimeMin": 180, + "PercentRead": 67.8, }, - "ContentId": mediaItemID, - "ReadingEvent": "Reading", - "RemainingTimeMin": 180, - "PercentRead": 67.8, } body, _ := json.Marshal(reqBody)