gotosocial
gotosocial copied to clipboard
[feature] Fetching remote accounts directly should refresh DB info
Due to restarting my instance at points I've obviously missed the profile change AP messages at some point so my profile data for multiple people is out of date. Performing a direct fetch of an account, i.e. visiting a user's profile page, should perform the equivalent of GetRemoteStatus(refresh = true)
to keep profiles up-to-date
Agree that this is a problem, but I'm not sure if we want to trigger a refresh every time a profile is visited directly, since this could easily end up spamming remote instances. I think it's probably better if we implement something with LastWebfingeredAt
on accounts; if an account hasn't been webfingered (ie., refreshed) in say 6 hours (or some other time limit), then a refresh is performed the next time an account is 'seen'. That seems less prone to spam, although the price we pay then is not having minute-to-minute updates of an account if we miss the Update activitypub message.
I mean even a 5 minute timeout would prevent spam and would ensure near-enough minute-to-minute updates IMO
Ah yes, so maybe we do a refresh UNLESS lastwebfingered at is within x amount of time? That could work indeed
We could do the same for fetching remote statuses in direct-view and their lastmodtime
-- which I'm assuming would allow us to keep some kind of an eye of favourites / reblogs count?
Reblog and favourite counts aren't pinned to the activitypub representation of the status, so thankfully we don't need to dereference a status once we've got it already (unless we assume some kind of 'Update' thing, which afaik not many (any?) AP implementations use yet). We just use the amount of reblogs and faves we've seen to generate those numbers :)
Ah gotcha that does make things much simpler :)
Would a combo of domain != nil && time.Now().Sub(lastmodtime) > threshold
do essentially the same on accounts? I'm just wondering if we need to use the last-webfingered check, as an account update via AP wouldn't update the webfingered time I'm assuming?
an account update via AP wouldn't update the webfingered time I'm assuming
Good point... Maybe we should change that column to 'lastDereferencedAt' and count an Update as a dereference (just one that we're having pushed to us, rather than pulling).
Sure a last modified time would serve this purpose? And have the bonus of not being useful only for remote accounts
Mmm yes on reflection I think you're right, maybe we can just drop 'lastWebfingeredAt' altogether then :)
Related to #822
closed by https://github.com/superseriousbusiness/gotosocial/pull/1411