summaryrefslogtreecommitdiff
path: root/internal/cache
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-09-04 18:06:26 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-09-04 18:06:26 +0200
commited3035699f9f41a3f92437ab7a3511d9969e1501 (patch)
tree79524f8daa72ef5d6481c2476816bb39d8cbcf7d /internal/cache
parent[chore] bump dependencies (#4406) (diff)
downloadgotosocial-ed3035699f9f41a3f92437ab7a3511d9969e1501.tar.xz
[bugfix] fix lo paging value not always being set (#4407)
the "lo" paging value wasn't always being set when loading statuses from the database. this seems to (potentially) fix an issue in tusky with list timelines showing repeated posts. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4407 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/cache')
-rw-r--r--internal/cache/timeline/status.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/cache/timeline/status.go b/internal/cache/timeline/status.go
index 6fe16c4a9..2efc17549 100644
--- a/internal/cache/timeline/status.go
+++ b/internal/cache/timeline/status.go
@@ -479,9 +479,6 @@ func loadStatusTimeline(
// limit of total we're expected to return.
nextPg.Limit = returnLimit - len(apiStatuses)
if nextPg.Limit <= 0 {
-
- // We reached the end! Set lo paging value.
- lo = apiStatuses[len(apiStatuses)-1].ID
break
}
@@ -533,6 +530,12 @@ func loadStatusTimeline(
)
}
+ if len(apiStatuses) > 0 {
+ // We finished loading statuses with
+ // values to return, set lo paging value.
+ lo = apiStatuses[len(apiStatuses)-1].ID
+ }
+
return apiStatuses, lo, hi, nil
}