Bluesky app fork with some witchin' additions 💫

init log using `getLog` (#7886)

authored by samuel.fm and committed by

GitHub 7222d6fe 8b6dde17

+9 -8
+9 -8
src/state/messages/events/agent.ts
··· 235 235 236 236 try { 237 237 const response = await networkRetry(2, () => { 238 - return this.agent.api.chat.bsky.convo.listConvos( 239 - { 240 - limit: 1, 241 - }, 238 + return this.agent.chat.bsky.convo.getLog( 239 + {}, 242 240 {headers: DM_SERVICE_HEADERS}, 243 241 ) 244 242 }) 245 243 // throw new Error('UNCOMMENT TO TEST INIT FAILURE') 246 244 247 - const {convos} = response.data 245 + const {cursor} = response.data 248 246 249 - for (const convo of convos) { 250 - if (convo.rev > (this.latestRev = this.latestRev || convo.rev)) { 251 - this.latestRev = convo.rev 247 + // should always be defined 248 + if (cursor) { 249 + if (!this.latestRev) { 250 + this.latestRev = cursor 251 + } else if (cursor > this.latestRev) { 252 + this.latestRev = cursor 252 253 } 253 254 } 254 255