From e187a977aa146eb5dcf1c952d6e5da92bc58c63c Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Wed, 10 Sep 2025 18:16:19 +0300 Subject: [PATCH] appview/posthog: capture string create/edit/delete ops Change-Id: opqukvovwkxrwmyluosnoqvyzwokrtot Signed-off-by: Anirudh Oppiliappan --- appview/posthog/notifier.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/appview/posthog/notifier.go b/appview/posthog/notifier.go index 80ff75c0..db0c2cd0 100644 --- a/appview/posthog/notifier.go +++ b/appview/posthog/notifier.go @@ -129,3 +129,36 @@ func (n *posthogNotifier) UpdateProfile(ctx context.Context, profile *db.Profile log.Println("failed to enqueue posthog event:", err) } } + +func (n *posthogNotifier) DeleteString(ctx context.Context, did, rkey string) { + err := n.client.Enqueue(posthog.Capture{ + DistinctId: did, + Event: "delete_string", + Properties: posthog.Properties{"rkey": rkey}, + }) + if err != nil { + log.Println("failed to enqueue posthog event:", err) + } +} + +func (n *posthogNotifier) EditString(ctx context.Context, string *db.String) { + err := n.client.Enqueue(posthog.Capture{ + DistinctId: string.Did.String(), + Event: "edit_string", + Properties: posthog.Properties{"rkey": string.Rkey}, + }) + if err != nil { + log.Println("failed to enqueue posthog event:", err) + } +} + +func (n *posthogNotifier) CreateString(ctx context.Context, string *db.String) { + err := n.client.Enqueue(posthog.Capture{ + DistinctId: string.Did.String(), + Event: "create_string", + Properties: posthog.Properties{"rkey": string.Rkey}, + }) + if err != nil { + log.Println("failed to enqueue posthog event:", err) + } +} -- 2.43.0