···582582 if err != nil {
583583 return fmt.Errorf("failed to parse study session at-uri: %w", err)
584584 }
585585+ subjectDid, err := subjectUri.Authority().AsDID()
586586+ if err != nil {
587587+ return fmt.Errorf("failed to identify subject did: %w", err)
588588+ }
585589586590 body := record.Body
587587- if len(body) == 0 {
591591+ if len(strings.TrimSpace(body)) == 0 {
588592 return fmt.Errorf("invalid body: length cannot be 0")
589593 }
590594···619623 tx.Rollback()
620624 return fmt.Errorf("failed to upsert comment record: %w", err)
621625 }
626626+627627+ err = db.CreateNotification(tx, subjectDid.String(), did, subjectUri.String(), db.NotificationTypeComment)
628628+ if err != nil {
629629+ log.Println("failed to create notification record:", err)
630630+ }
631631+622632 return tx.Commit()
623633 case models.CommitOperationDelete:
624634 log.Println("deleting comment from pds request")
+1-1
internal/db/db.go
···193193 subject_uri text not null,
194194195195 state text not null default 'unread' check(state in ('unread', 'read')),
196196- type text not null check(type in ('follow', 'reaction')),
196196+ type text not null check(type in ('follow', 'reaction', 'comment')),
197197198198 created_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
199199