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

Add a @State date to the ProfileView that we use when refreshing auth… #1751

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

mplorentz
Copy link
Member

Issues covered

Continuing the saga on https://github.com/verse-pbc/issues/issues/171 and https://github.com/verse-pbc/issues/issues/175

Description

I caught the infinite loop in the debugger again on c1c2bc54d. I confirmed my hunch described in #1748 that the ProfileView.downloadAuthorData() function was downloading author data and triggering a refresh of the ProfileView, triggering another download of author data, creating an infinite loop.

This time my attempt at a fix is to keep track of a lastDownloadedAuthorData in @State. This date is nil when the view is first shown, which ensures that we grab the latest contact list every time. But after that we only look for newer data since the last fetch.

I also fixed an issue where the author metadata wasn't being re-fetched on pull-to-refresh.

How to test

🤷‍♂️ at this point I would say just make sure the profile view seems to fetch data correctly. And keep an eye on the logs for the parse queue growing indefinitely.

@pelumy
Copy link
Contributor

pelumy commented Jan 31, 2025

👀

Copy link
Contributor

@pelumy pelumy left a comment

Choose a reason for hiding this comment

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

Nice catch. Looks good to me.

@pelumy pelumy added this pull request to the merge queue Jan 31, 2025
Merged via the queue into main with commit 587ac92 Jan 31, 2025
4 checks passed
@pelumy pelumy deleted the another-fix-for-infinite-profileview-refresh branch January 31, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants