feat(notification): tell an author when their post is quoted - #241
Closed
aquie00t wants to merge 1 commit into
Closed
feat(notification): tell an author when their post is quoted#241aquie00t wants to merge 1 commit into
aquie00t wants to merge 1 commit into
Conversation
Being quoted is a louder signal than a like - somebody has said something about your post to their own followers - and until now it arrived silently, as a number going up. The notification leads to the quote rather than to the post being quoted: the recipient already knows their own post, what they want to open is what was said about it, and the quote carries the original as its card anyway. That also buys the cleanup for free, since Notification.post cascades - deleting the quote takes its notification with it, with no undo path to write. NotifyQuotedAuthorUseCase sits beside NotifyNewPostUseCase and resolves the quoted author itself, so post creation gains one collaborator rather than two and its transaction keeps its shape. It runs after the commit and fire-and-forget: the post is the thing worth keeping, so a notification failure is logged rather than allowed to fail the request or roll the write back. An account quoting itself notifies nobody. First enum change in the repository; the migration carries the note about ALTER TYPE ... ADD VALUE inside Prisma's migration transaction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JC6UgjwRSJ3KHToPYqBPC
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alıntı özelliğinin üçüncü PR'ı. Base'i
maindeğil, #240'ın dalı (feature/post-quote-count) — zincir tek seferde merge edilip tek deploy olacak.Ne değişti
NotificationType.QUOTE— Prisma enum + domain enum + migration. HTTP şemasıFBType.Enum(NotificationType)kullandığı için kendiliğinden kazandı.NotifyQuotedAuthorUseCase—NotifyNewPostUseCase'in kardeşi: alıntılanan postun yazarını kendi çözüyor, bildirimi yazıyor ve realtime olayı gönderiyor.CreatePostUseCase— commit sonrası, mevcut takipçi fan-out'unun yanında fire-and-forget çağrı.Kararlar
Notification.postcascade'li, yani alıntı silinince bildirim de gidiyor —unlikeyolundaki gibi elle temizleme koduna gerek kalmıyor.LikePostUseCasebildirimi transaction içinde yaratıyor ama oradaki yazma zaten beğeninin kendisi. Burada yazma post; bir bildirim hatası isteği düşürmemeli ya da PR 2'de kurulan yazma transaction'ını geri sardırmamalı.CreatePostUseCaseiki değil bir collaborator kazanıyor ve transaction'ın dönüş şekli değişmiyor. Ekstra okuma kritik yolun dışında.Doğrulama
pnpm test:unit→ 895/895 geçti. Yeni:notify-quoted-author.usecase.test.ts(5 durum), create-post'a 3 durum.enums.test.ts'teki "tam 6 değer" iddiası 7'ye güncellendi veQUOTEiçin ayrı bir iddia eklendi.pnpm lint,pnpm format:check,tsc --noEmittemiz.ALTER TYPE ... ADD VALUEPrisma'nın migration transaction'ı içinde sorunsuz koştu (repodaki ilk enum değişikliği, gerekçe migration dosyasında).migrate diffsıfır drift.QUOTE,postIdalıntıyı işaret ediyor,referenceIdonu yansıtıyor, issuer doğru, realtime olayı gidiyor, alıntılayan bildirim almıyor, kendi postunu alıntılamak sessiz kalıyor, alıntı silinince bildirim cascade ile gidiyor.tests/e2e/notification/quote.test.ts, 4 durum) CI'da koşacak.Sonraki PR
GET /posts/:id/quotes+ metinsiz alıntı (saf repost)🤖 Generated with Claude Code
https://claude.ai/code/session_015JC6UgjwRSJ3KHToPYqBPC