···869869 ? ""
870870 : readCollectionCursor(this.dataStore.$convoMessages, { key: convoId });
871871 const res = await this.api.getMessages(convoId, { cursor, limit });
872872- // Hack - sometimes the first response comes back with a cursor, even though it shouldn't.
873873- // So, let's just make another request to check if it's actually valid.
874874- if (res.cursor) {
875875- const res2 = await this.api.getMessages(convoId, {
872872+ if (res.messages.length === 0 && res.cursor) {
873873+ console.warn("getMessages returned an empty page with a cursor", {
874874+ convoId,
876875 cursor: res.cursor,
877877- limit: 1,
878876 });
879879- if (res2.messages.length === 0) {
880880- res.cursor = null;
881881- }
877877+ res.cursor = null;
882878 }
883879 // For group convos, convo.members is partial; relatedProfiles carries
884880 // the authors and system-message subjects for the returned page.