Skip to content

federation/cache: Add Context parameter to <X>Cache - #503

Open
timedoutuk wants to merge 3 commits into
mainfrom
timedoutuk/cache-context
Open

federation/cache: Add Context parameter to <X>Cache#503
timedoutuk wants to merge 3 commits into
mainfrom
timedoutuk/cache-context

Conversation

@timedoutuk

Copy link
Copy Markdown
Member

Checklist

@timedoutuk
timedoutuk requested a review from tulir May 17, 2026 17:28
Comment thread federation/serverauth.go
if res.HasKey(keyID) {
return res, nil
} else if !sa.Keys.ShouldReQuery(serverName) {
} else if shouldQuery, err := sa.Keys.ShouldReQuery(ctx, serverName); !shouldQuery {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Error case should be logged separately

Comment thread federation/httpclient.go
return nil, err
} else {
srt.cache.StoreResolution(res)
srt.cache.StoreResolution(ctx, res)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should log errors

Comment thread federation/serverauth.go
res, err = sa.Client.ServerKeys(ctx, serverName)
if err != nil {
sa.Keys.StoreFetchError(serverName, err)
sa.Keys.StoreFetchError(ctx, serverName, err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be worth logging errors here too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants