This repository has no description

likes: key on AT-URI, refuse double-likes master

The Like model used CID as its primary key, but a CID isn't unique per like: two users liking the same subject at the same createdAt produce byte-identical records (same $type/subject/createdAt) and thus the same CID, so the second like would collide on the primary key and be lost. Key on the AT-URI instead, which is unique per record (repo + rkey). Refuse to index a like when that user already likes the subject: the firehose handler now checks GetLikeBySubjectAndUser before CreateLike and skips duplicates, so a user can't inflate a count by liking twice. Also fix GetLikeBySubjectAndUser swallowing non-not-found DB errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>


+52 -11
3 changed files