Skip to content
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

Fix "Load More" Button on Home/Public Timeline #1283

Merged
merged 12 commits into from
May 8, 2024
Merged

Conversation

kimar
Copy link
Contributor

@kimar kimar commented May 3, 2024

This PR fixes the broken Gap Loading aka. "Load More".

Currently the "Load More"-button is never shown on the timeline, but there might be gaps in the timeline.

@kimar kimar requested a review from zeitschlag May 3, 2024 12:33
@kimar kimar self-assigned this May 3, 2024
@kimar kimar marked this pull request as ready for review May 3, 2024 12:33
@kimar kimar marked this pull request as draft May 3, 2024 12:33
@kimar kimar marked this pull request as ready for review May 6, 2024 07:15
Copy link
Contributor

@zeitschlag zeitschlag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works like a charm! Thank you for your work. 👍 🚀

As already mentioned elsewhere: The order of the statuses is weird sometimes after I pressed the "Load More"-button. I saw that using the displayed timestamps (I didn't run a debugger or so, sorry). What I could imagine is that it's about maxID and sinceID? But honestly: I don't know and don't consider this something blocking as it looks more like a UI-issue to me.


/// To find out wether or not we need to show the "Load More" button
/// we have make sure to eventually overlap with the most recent cached item
let sinceID = latestFeedRecords.count > 1 ? latestFeedRecords[1].id : "1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reascon sinceID is not an optional?
Both Timeline-calls support sinceID being nil and 1 as fallback confused me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have adopted this from the Android implementation, there sinceID is also optional but when loading the Gaps it is explicitly using 1 which makes me assume the API has a different behavior when not setting the value at all.

@kimar kimar merged commit 6776700 into develop May 8, 2024
2 checks passed
@kimar kimar deleted the IOS-266_Fix_Load_More branch May 8, 2024 08:02
@zeitschlag zeitschlag added this to the 2024.5 milestone May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants