···896896 limit,
897897 labelers,
898898 });
899899- if (res.messages.length === 0 && res.cursor) {
900900- console.warn("getMessages returned an empty page with a cursor", {
901901- convoId,
902902- cursor: res.cursor,
903903- });
904904- res.cursor = null;
905905- }
906899 // For group convos, convo.members is partial; relatedProfiles carries
907900 // the authors and system-message subjects for the returned page.
908901 if (res.relatedProfiles) {
-12
tests/unit/specs/dataLayer/requests.test.js
···18241824 assert.deepEqual(stored.messages[1].id, "m2");
18251825 });
1826182618271827- it("should null out cursor when a page comes back empty with a cursor", async () => {
18281828- const dataStore = new DataStore();
18291829- const mockApi = {
18301830- getMessages: async () => ({ messages: [], cursor: "fakecursor" }),
18311831- };
18321832- const requests = makeRequests(mockApi, dataStore);
18331833-18341834- await requests.loadConvoMessages(convoId);
18351835-18361836- assert.deepEqual(dataStore.$convoMessages.get(convoId).cursor, null);
18371837- });
18381838-18391827 it("should reset on reload", async () => {
18401828 const dataStore = new DataStore();
18411829 dataStore.$convoMessages.set(convoId, {