mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-08 17:36:45 +08:00
* feat(telemetry): report visiting and delegating member counts in self-host snapshot v2 (MUL-8161) Co-authored-by: multica-agent <[email protected]> * fix(telemetry): count delegating members from a human-action ledger, drop v1 fallback (MUL-8161) - member_delegation_day records (member, UTC day) at the human action itself, so retries, system wakeups and creator-fallback runs never count, and a comment folded into a queued run keeps both humans and their own days. - Activity read failures now fail collection and use the existing retry instead of silently sending a v1 snapshot. Co-authored-by: multica-agent <[email protected]> * fix(telemetry): record create-with-assignee, honor DO_NOT_TRACK, build ledger PK concurrently (MUL-8161) - A member creating an issue assigned to an agent or squad now records a delegation day, on both the immediate and deferred create paths. - TaskService.RecordMemberActivity gates the ledger and is set from the startup telemetry config, so DO_NOT_TRACK stops collection too. - member_delegation_day's primary key is built with CREATE UNIQUE INDEX CONCURRENTLY + PRIMARY KEY USING INDEX (589-591), with cleanup registered. Co-authored-by: multica-agent <[email protected]> --------- Co-authored-by: multica-agent <[email protected]>
33 lines
845 B
Go
33 lines
845 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
// source: member_delegation.sql
|
|
|
|
package db
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
const recordMemberDelegationDay = `-- name: RecordMemberDelegationDay :exec
|
|
INSERT INTO member_delegation_day (user_id, activity_date)
|
|
VALUES (
|
|
$1,
|
|
(COALESCE($2::timestamptz, CURRENT_TIMESTAMP) AT TIME ZONE 'UTC')::date
|
|
)
|
|
ON CONFLICT DO NOTHING
|
|
`
|
|
|
|
type RecordMemberDelegationDayParams struct {
|
|
UserID pgtype.UUID `json:"user_id"`
|
|
ActedAt pgtype.Timestamptz `json:"acted_at"`
|
|
}
|
|
|
|
// Idempotent: one row per member per UTC day. acted_at NULL means now.
|
|
func (q *Queries) RecordMemberDelegationDay(ctx context.Context, arg RecordMemberDelegationDayParams) error {
|
|
_, err := q.db.Exec(ctx, recordMemberDelegationDay, arg.UserID, arg.ActedAt)
|
|
return err
|
|
}
|