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

libkb: clear stale bit after refresh #20096

Merged
merged 1 commit into from Oct 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions go/libkb/upak_loader.go
Expand Up @@ -294,6 +294,13 @@ func (u *CachedUPAKLoader) putUPAKToCache(ctx context.Context, obj *keybase1.Use
uid := obj.Current.Uid
u.G().VDL.CLogf(ctx, VLog0, "| Caching UPAK for %s %s", uid, stubMode)

// At this point, we've gone to the server, and we checked that the user is fresh, so if we previously had a stale
// bit set for this user, we'll turn it off now.
Copy link
Contributor

Choose a reason for hiding this comment

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

We are sure this can't be called on any other code path other than after fetching from server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To the best of my knowledge.

if obj.Stale {
u.G().VDL.CLogf(ctx, VLog0, "| resetting stale bit to false for %s %s", uid, stubMode)
obj.Stale = false
}

existing := u.getMemCache(ctx, uid, stubMode)

if existing != nil && obj.IsOlderThan(*existing) {
Expand Down