From ea4af41bc39bd7fa03fb9e101baf614c0b62f189 Mon Sep 17 00:00:00 2001 From: Grace Kind Date: Fri, 10 Jul 2026 18:56:47 -0500 Subject: [PATCH] Remove message API probe --- package.json | 2 +- src/js/dataLayer/requests.js | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 42af7692..d08449b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "impro", - "version": "0.17.124", + "version": "0.17.125", "type": "module", "scripts": { "start": "rm -rf \"${BUILD_DIR:-build}\" && NODE_ENV=development eleventy --serve", diff --git a/src/js/dataLayer/requests.js b/src/js/dataLayer/requests.js index f381ef5b..628996f8 100644 --- a/src/js/dataLayer/requests.js +++ b/src/js/dataLayer/requests.js @@ -869,16 +869,12 @@ export class Requests { ? "" : readCollectionCursor(this.dataStore.$convoMessages, { key: convoId }); const res = await this.api.getMessages(convoId, { cursor, limit }); - // Hack - sometimes the first response comes back with a cursor, even though it shouldn't. - // So, let's just make another request to check if it's actually valid. - if (res.cursor) { - const res2 = await this.api.getMessages(convoId, { + if (res.messages.length === 0 && res.cursor) { + console.warn("getMessages returned an empty page with a cursor", { + convoId, cursor: res.cursor, - limit: 1, }); - if (res2.messages.length === 0) { - res.cursor = null; - } + res.cursor = null; } // For group convos, convo.members is partial; relatedProfiles carries // the authors and system-message subjects for the returned page. -- 2.51.2