Add a @State date to the ProfileView that we use when refreshing auth… #1751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theProfileView.downloadAuthorData()
function was downloading author data and triggering a refresh of theProfileView,
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.