nandi/gleanpublic Fork 0
5264ada
Commits
Clone
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

fix: fix annotation filtering in article handlerUnverified

Julien Robert committed 2026-06-08T17:13:18+02:00 Browse files
5264ada parent: 2b8e65c
modified internal/db/social.go +2 -0
@@ -122,6 +122,8 @@ func (s *ArticleStore) ListAnnotations(ctx context.Context, feedURL, articleURL,
122122 if articleURL != "" {
123123 conds = append(conds, "a.article_url = ?")
124124 args = append(args, articleURL)
125+ } else if feedURL != "" {
126+ conds = append(conds, "(a.article_url = '' OR a.article_url IS NULL)")
125127 }
126128 if authorDID != "" {
127129 conds = append(conds, "a.author_did = ?")
@@ -122,6 +122,8 @@ func (s *ArticleStore) ListAnnotations(ctx context.Context, feedURL, articleURL,
122 if articleURL != "" {122 if articleURL != "" {
123 conds = append(conds, "a.article_url = ?")123 conds = append(conds, "a.article_url = ?")
124 args = append(args, articleURL)124 args = append(args, articleURL)
125+ } else if feedURL != "" {
126+ conds = append(conds, "(a.article_url = '' OR a.article_url IS NULL)")
125 }127 }
126 if authorDID != "" {128 if authorDID != "" {
127 conds = append(conds, "a.author_did = ?")129 conds = append(conds, "a.author_did = ?")
modified internal/server/articles_handler.go +1 -1
@@ -254,7 +254,7 @@ func (s *Server) handleArticleDetail(w http.ResponseWriter, r *http.Request) {
254254
255255 g.Go(func() error {
256256 var err error
257- annotations, err = s.dbs.Articles.ListAnnotations(gCtx, "", article.URL.String, "", 20, 0)
257+ annotations, err = s.dbs.Articles.ListAnnotations(gCtx, article.FeedURL, article.URL.String, "", 20, 0)
258258 if err != nil {
259259 s.logger.Warn("failed to list annotations", "error", err)
260260 return nil
@@ -254,7 +254,7 @@ func (s *Server) handleArticleDetail(w http.ResponseWriter, r *http.Request) {
254 254
255 g.Go(func() error {255 g.Go(func() error {
256 var err error256 var err error
257- annotations, err = s.dbs.Articles.ListAnnotations(gCtx, "", article.URL.String, "", 20, 0)257+ annotations, err = s.dbs.Articles.ListAnnotations(gCtx, article.FeedURL, article.URL.String, "", 20, 0)
258 if err != nil {258 if err != nil {
259 s.logger.Warn("failed to list annotations", "error", err)259 s.logger.Warn("failed to list annotations", "error", err)
260 return nil260 return nil