aboutsummaryrefslogtreecommitdiff
path: root/backend/fetchers/app.bsky.feed.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/fetchers/app.bsky.feed.go')
-rw-r--r--backend/fetchers/app.bsky.feed.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/fetchers/app.bsky.feed.go b/backend/fetchers/app.bsky.feed.go
index 4c6b92f..16e93c5 100644
--- a/backend/fetchers/app.bsky.feed.go
+++ b/backend/fetchers/app.bsky.feed.go
@@ -40,12 +40,16 @@ func FetchAppBskyFeedPosts(logger *slog.Logger, did, pdsURL, slingshotURL string
func GetAppBskyFeedPostByURI(logger *slog.Logger, uri, slingshotURL string, session *auth.OAuthState, cache *Cache) (*notes.Note, error) {
// check cache, return if it was cached without auth or if it was cached with auth and we have auth
+ logger.Debug("Getting app.bsky.feed.post", "uri", uri)
if cached, found := cache.Get(uri); found {
+ logger.Debug("Found in the cache", "public", !cached.AuthorNoUnauth)
if !cached.AuthorNoUnauth {
return cached, nil
}
- if general.IsValidSession(session) {
+ // author requires auth - if we have a session, serve it
+ // if the token was invalid, trust that it would have been caught by the "refresh token" call in main
+ if session != nil {
return cached, nil
}
}
@@ -61,6 +65,7 @@ func FetchAppBskyFeedPostByURI(logger *slog.Logger, uri, slingshotURL string, se
if err != nil {
return nil, err
}
+ logger.Debug("fetched origin PDS", "did", repo, "pdsURL", pdsURL)
// get author of the note
author, found := cache.GetProfile(repo)