Skip to content

feat(engagement): track-engagement Edge Function with batch upsert (#179)#228

Merged
Azfe merged 3 commits into
developfrom
task/n04-02-02-edge-function-track-engagement
Jul 10, 2026
Merged

feat(engagement): track-engagement Edge Function with batch upsert (#179)#228
Azfe merged 3 commits into
developfrom
task/n04-02-02-edge-function-track-engagement

Conversation

@Azfe

@Azfe Azfe commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Rewrite the Edge Function to accept event batches (array or { events: [] }), validate with zod, authenticate via JWT, and delegate to a new apply_engagement_events RPC (append-only link_clicked, status transition, focused_seconds accumulation, max_scroll_pct max, per-post pre-aggregation). Conform the trackLinkClick client to the array contract. Add pgTAP + real-DB integration tests, the endpoint README, and allow console in edge functions.

Closes #179

@Azfe
Azfe merged commit 05e7014 into develop Jul 10, 2026
6 checks passed
@Azfe
Azfe deleted the task/n04-02-02-edge-function-track-engagement branch July 10, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant