back interdiff of round #1 and #0

feat: replies #2

merged
opened by brookjeynes.dev targeting master from bj/2025-09-22/feat/replies

Adds replies to Yoten

REVERTED
internal/consumer/ingester.go
···
return fmt.Errorf("failed to start transaction: %w", err)
}
+
// TODO: Parse reply
-
var parentCommentUri *syntax.ATURI = nil
-
reply := record.Reply
-
if reply != nil {
-
parentUri, err := syntax.ParseATURI(reply.Parent)
-
if err != nil {
-
return fmt.Errorf("failed to parse parent at-uri: %w", err)
-
}
-
parentCommentUri = &parentUri
-
}
comment := db.Comment{
+
Did: did,
+
Rkey: e.Commit.RKey,
+
StudySessionUri: subjectUri,
+
Body: body,
+
CreatedAt: createdAt,
-
Did: did,
-
Rkey: e.Commit.RKey,
-
StudySessionUri: subjectUri,
-
ParentCommentUri: parentCommentUri,
-
Body: body,
-
CreatedAt: createdAt,
}
log.Println("upserting comment from pds request")
ERROR
internal/db/comment.go

Failed to calculate interdiff for this file.

ERROR
internal/server/handlers/comment.go

Failed to calculate interdiff for this file.

ERROR
internal/server/handlers/router.go

Failed to calculate interdiff for this file.

ERROR
internal/server/handlers/study-session.go

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/comment.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/discussion.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/edit-comment.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/partials.go

Failed to calculate interdiff for this file.

ERROR
internal/server/views/partials/reply.templ

Failed to calculate interdiff for this file.

ERROR
internal/server/views/study-session.templ

Failed to calculate interdiff for this file.

REVERTED
migrations/update_notification_type.sql
···
-
-- This script should be used and updated whenever a new notification type
-
-- constraint needs to be added.
-
-
BEGIN TRANSACTION;
-
-
ALTER TABLE notifications RENAME TO notifications_old;
-
-
CREATE TABLE notifications (
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
-
recipient_did TEXT NOT NULL,
-
actor_did TEXT NOT NULL,
-
subject_uri TEXT NOT NULL,
-
state TEXT NOT NULL DEFAULT 'unread' CHECK(state IN ('unread', 'read')),
-
type TEXT NOT NULL CHECK(type IN ('follow', 'reaction', 'comment')),
-
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
-
FOREIGN KEY (recipient_did) REFERENCES profiles(did) ON DELETE CASCADE,
-
FOREIGN KEY (actor_did) REFERENCES profiles(did) ON DELETE CASCADE
-
);
-
-
INSERT INTO notifications (id, recipient_did, actor_did, subject_uri, state, type, created_at)
-
SELECT id, recipient_did, actor_did, subject_uri, state, type, created_at
-
FROM notifications_old;
-
-
DROP TABLE notifications_old;
-
-
COMMIT;
NEW
internal/db/notification.go
···
NotificationTypeFollow NotificationType = "follow"
NotificationTypeReaction NotificationType = "reaction"
NotificationTypeComment NotificationType = "comment"
+
NotificationTypeReply NotificationType = "reply"
)
type NotificationState string