Skip to content

fix(functions): keep execution logs and errors out of realtime payloads - #15024

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/execution-logs-realtime
Oct 27, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/execution-logs-realtime

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Execution events published by the functions worker and the execution delete endpoint now mark logs and errors as sensitive, so realtime subscribers get the same view of an execution as the REST API gives them.

Lint, PHPStan and the touched unit tests passed locally before rebasing on main; e2e runs in CI.

Related: appwrite-labs/cloud#6673

Execution events published by the functions worker and the execution delete endpoint now mark logs and errors as sensitive, so realtime subscribers get the same view of an execution as the REST API gives them.
@luxor-code-review

luxor-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Redact logs/errors in schedule-cancel delete event too (Delete.php) — The PR strips logs and errors from the execution delete event payload on the completed/failed path (Executions/Delete.php:212), but the schedule-cancel branch of the same action emits the same functions.[functionId].executions.[executionId].delete event without the sensitive flag.

The change adds sensitive: ['logs', 'errors'] to the setPayload() calls that publish executions.update and executions.delete events, so the realtime fan-out (Realtime::getRealtimePayload()) drops these keys from subscriber-visible payloads. The delete endpoint also emits a proper functions.[functionId].executions.[executionId].delete event with a 204 response, and an e2e realtime test now asserts logs/errors are absent from execution events seen by client subscribers.

Files Change
src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php Emits the execution delete event with sensitive: ['logs', 'errors'] and returns 204 after deleting the execution document.
src/Appwrite/Platform/Workers/Functions.php Adds the same sensitive flag to the execution update event published by the builds worker.
tests/e2e/Services/Realtime/RealtimeCustomClientTest.php Extends the realtime e2e suite to assert logs/errors are stripped from execution events.

Note: the same issue appears in the schedule-cancel branch of Executions/Delete.php (line 157), which emits the identical delete event without the sensitive flag — flagged in the findings below.

Reviewed commit: 1731eb2

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 27, 2026
@ghost

ghost commented Oct 27, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The changes consistently apply the existing realtime sensitive-field mechanism and exercise both event paths in e2e coverage.

Function execution update and delete events now mark logs and errors as sensitive so those fields are omitted from realtime payloads. The realtime e2e test checks that both event types omit the fields.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php Marks execution-delete payload logs and errors as sensitive.
src/Appwrite/Platform/Workers/Functions.php Marks execution-update payload logs and errors as sensitive.
tests/e2e/Services/Realtime/RealtimeCustomClientTest.php Asserts execution update and delete realtime payloads omit logs and errors.

Reviewed 1731eb2 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

6 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (3)
  • php.appwrite.secret-compare-timing (1)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/execution-logs-realtime (after).

Metric Before After Change
🚀 Requests/sec 182.9 186.13 ⚪ +1.8%
⏱️ Latency P50 94.75 ms 93.82 ms ⚪ -1%
⏱️ Latency P95 221.27 ms 216.76 ms ⚪ -2%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 93.82 216.76 11,514 186.13 -4.52
Account 166.95 303.01 606 10.04 -49.73
TablesDB 90.88 168.87 6,262 102.96 -1.4
Storage 86.45 205.57 3,030 52.05 +4.34
Functions 127.4 250.82 1,616 28.47 -15.89

Top API waits (after)

API request Max wait (ms)
account.name.update 521.79
storage.buckets.create 436.48
functions.variables.delete 414.52
account.prefs.update 396.74
storage.files.create 389.86

@ChiragAgg5k
ChiragAgg5k merged commit 3c197aa into main Oct 27, 2026
40 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/execution-logs-realtime branch October 27, 2026 19:18
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