Yōten: A social platform for tracking the essential points of your language learning yoten.app
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: parent URI being an empty string when it should be nil

Signed-off-by: brookjeynes <me@brookjeynes.dev>

author
brookjeynes
date (Jun 10, 2026, 6:29 AM +1000) commit 6497174a parent e13f52bf change-id kyzontkr
+7 -7
+1 -1
internal/consumer/ingester.go
··· 656 656 return fmt.Errorf("failed to start tx: %w", err) 657 657 } 658 658 659 - var parentCommentURI *syntax.ATURI 659 + var parentCommentURI *syntax.ATURI = nil 660 660 reply := record.Reply 661 661 if reply != nil && reply.Parent != "" { 662 662 parentURI, err := syntax.ParseATURI(reply.Parent)
+5 -5
internal/db/comment.go
··· 165 165 func GetCommentsForSession(e Execer, studySessionURI string, limit, offset int) ([]domain.Comment, error) { 166 166 topLevelCommentsQuery := ` 167 167 select 168 - c.id, c.did, c.rkey, c.study_session_uri, c.parent_comment_uri, 169 - c.body, c.is_deleted, c.created_at 168 + id, did, rkey, study_session_uri, parent_comment_uri, 169 + body, is_deleted, created_at 170 170 from comments c 171 - where c.study_session_uri = ? and c.parent_comment_uri is null 172 - order by c.created_at asc 171 + where study_session_uri = ? and (parent_comment_uri is null or parent_comment_uri = '') 172 + order by created_at asc 173 173 limit ? offset ?; 174 174 ` 175 175 rows, err := e.Query(topLevelCommentsQuery, studySessionURI, limit, offset) ··· 314 314 } 315 315 comment.StudySessionURI = parsedStudySessionURI 316 316 317 - if parentURI.Valid { 317 + if parentURI.Valid && parentURI.String != "" { 318 318 parsedParentURI, err := syntax.ParseATURI(parentURI.String) 319 319 if err != nil { 320 320 return domain.Comment{}, fmt.Errorf("failed to parse at-uri: %w", err)
+1 -1
internal/server/handlers/comment.go
··· 69 69 return 70 70 } 71 71 72 - userReply := new(yoten.FeedComment_Reply) 72 + var userReply *yoten.FeedComment_Reply = nil 73 73 var parentCommentURI *string 74 74 parentCommentURIStr := r.FormValue("parent_uri") 75 75 if len(parentCommentURIStr) != 0 {