diff --git a/native_backends.go b/native_backends.go index 16a0bf3..e1d88d1 100644 --- a/native_backends.go +++ b/native_backends.go @@ -50,6 +50,7 @@ func RecordActivity(_, _, _, _ string, _ any) {} // ptrOf and hostError are used by wasm_backends.go (wasip1 only); provide // stubs here so the non-WASM build does not need them. +// //nolint:unused // used in wasm_backends.go in WASM builds type hostError struct{ msg string } diff --git a/wasm_backends.go b/wasm_backends.go index 8e6e2eb..7fc01e3 100644 --- a/wasm_backends.go +++ b/wasm_backends.go @@ -185,7 +185,7 @@ func EmitEvent(topic string, payload any) { type activityInput struct { TaskID string `json:"task_id"` ProjectID string `json:"project_id"` - ActorID string `json:"actor_id"` + ActorID string `json:"actor_id,omitempty"` ActivityType string `json:"activity_type"` Content any `json:"content"` } @@ -202,13 +202,8 @@ func RecordActivity(taskID, projectID, actorUserID, activityType string, content ActivityType: activityType, Content: content, } - payloadBytes, err := json.Marshal(inp) - if err != nil { - return - } - if !hostActivityRecord(int64(ptrOf(payloadBytes)), int64(len(payloadBytes))) { - return - } + payloadBytes, _ := json.Marshal(inp) + hostActivityRecord(int64(ptrOf(payloadBytes)), int64(len(payloadBytes))) } // ── Helpers ───────────────────────────────────────────────────────────────────