-
Notifications
You must be signed in to change notification settings - Fork 68
fix: disable loading when there are no more activities to load #1931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1931 +/- ##
==========================================
- Coverage 30.89% 30.85% -0.04%
==========================================
Files 43 43
Lines 1615 1617 +2
Branches 110 110
==========================================
Hits 499 499
- Misses 1090 1092 +2
Partials 26 26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/backport to stable31 |
|
/backport to stable30 |
|
/backport to stable29 |
Activity
|
||||||||||||||||||||||||||||
| Project |
Activity
|
| Branch Review |
fix/endless-spinner
|
| Run status |
|
| Run duration | 02m 42s |
| Commit |
|
| Committer | Hamza |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
3
|
|
|
0
|
|
|
0
|
|
|
10
|
| View all changes introduced in this branch ↗︎ | |
| hasMoreActivites.value = true | ||
| // If less than the hardcoded limit, there are no more activities | ||
| if (response.data.ocs.data.length < 50) { | ||
| hasMoreActivites.value = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible improvement in the future: Check again after a timeout if there is something new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This completely breaks the activity stream and needs reverting!
Basically if you upload more than 50 files, it will be the end of your activity stream. In fact 3 uploads will be enough already. You ask the backend for 50 entries, but only get 48, as 3 of them are combined into 1 entry
I see it's also broken before with the loading spinner you tried to fix, but that is another problem. Checking the result size is not the solution. Whether or not you reached the end of the activity stream is indicated by the HTTP status code 304:
https://github.com/nextcloud/activity/blob/master/docs/endpoint-v2.md#http-status
Signed-off-by: Hamza Mahjoubi <[email protected]>
2616b3a to
9ec95b2
Compare
Fix #1909
I couldn't reproduce in a deterministic manner
useInfiniteScrolldoesn't always trigger for pages with 1,2 activities disabling it makes reproduction easier.Repro:
304response loading Icons doesn't disappear