diff options
| author | 2025-05-17 11:52:49 +0000 | |
|---|---|---|
| committer | 2025-05-17 11:52:49 +0000 | |
| commit | 3a29a59e55dc8aa8a9bf31395f0f942eea700919 (patch) | |
| tree | 706769c356185140ef0c09f6840fcf2e810e58fa /internal/cache/timeline/status.go | |
| parent | [chore] various federatingdb tweaks (#4178) (diff) | |
| download | gotosocial-3a29a59e55dc8aa8a9bf31395f0f942eea700919.tar.xz | |
[bugfix] fix case of failed timeline preload causing lockups (#4182)
- moves preloader Done() function calling to be handled entirely by the preloader, not the caller
- adds tests for multiple preload success / failure / clear states
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4182
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/cache/timeline/status.go')
| -rw-r--r-- | internal/cache/timeline/status.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/internal/cache/timeline/status.go b/internal/cache/timeline/status.go index c0c394042..59c339c91 100644 --- a/internal/cache/timeline/status.go +++ b/internal/cache/timeline/status.go @@ -196,14 +196,9 @@ func (t *StatusTimeline) Preload( n int, err error, ) { - t.preloader.CheckPreload(func(ptr *any) { + err = t.preloader.CheckPreload(func() error { n, err = t.preload(loadPage, filter) - if err != nil { - return - } - - // Mark as preloaded. - t.preloader.Done(ptr) + return err }) return } |
