Commit 519c08e
committed
fix(chat): don't skip the initial backlog fetch on a stale lastMessage
loadInitialMessages skipped the network fetch entirely whenever the
local chat block already reached conversationModel.lastMessage.id,
trusting that value as proof we were caught up with the server. That
field is only as fresh as the last room list sync, though: a message
sent while the app had the conversation list open but the chat closed
(and no push-triggered catch-up ran, e.g. on flavors without FCM)
never updates it. Opening the chat then wrongly concluded there was
nothing to fetch, leaving the newest message missing until whatever
live-update mechanism happened to be active caught up on its own.
Always close the backlog from the newest locally known message
instead of gating on the conversation's cached lastMessage. closeBacklog
is a single cheap request when there is genuinely nothing new, so
there is no upside to trusting a value that isn't guaranteed current.
Drop ChatMessageSyncer.seedHttpSyncedMessageId with it: it existed
only to seed the insurance anchor from that same stale field for the
now-removed branch, and has no other caller.
Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>1 parent 9c9db41 commit 519c08e
3 files changed
Lines changed: 7 additions & 43 deletions
File tree
- app/src
- main/java/com/nextcloud/talk/chat/data/network
- test/java/com/nextcloud/talk/chat/data/network
Lines changed: 1 addition & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | 299 | | |
309 | 300 | | |
310 | 301 | | |
| |||
Lines changed: 6 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | 191 | | |
194 | 192 | | |
195 | | - | |
196 | 193 | | |
197 | 194 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | 195 | | |
219 | 196 | | |
220 | 197 | | |
| |||
223 | 200 | | |
224 | 201 | | |
225 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
226 | 209 | | |
227 | 210 | | |
228 | 211 | | |
| |||
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | 405 | | |
416 | 406 | | |
417 | 407 | | |
| |||
0 commit comments