From 15c6e3c00798ee9644ba7d6c3492235f459a32be Mon Sep 17 00:00:00 2001 From: pikann Date: Tue, 12 May 2026 10:24:34 +0700 Subject: [PATCH 1/2] fix: update activityInput struct to make ActorID omitempty and simplify RecordActivity function --- wasm_backends.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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 ─────────────────────────────────────────────────────────────────── From 853ee77ec1b66e9e767bb2773ccb46fd88b344d1 Mon Sep 17 00:00:00 2001 From: pikann Date: Tue, 12 May 2026 10:28:28 +0700 Subject: [PATCH 2/2] fix: add comment to clarify purpose of hostError struct in native_backends.go --- native_backends.go | 1 + 1 file changed, 1 insertion(+) 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 }