From 752f882eba0bf6961df2fbc02a95b9946510b0c9 Mon Sep 17 00:00:00 2001 From: batuhan Date: Wed, 26 Aug 2026 15:40:31 +0000 Subject: [PATCH 1/2] docs(comments): say which parts need a published Space sf dev brokers no platform services, so the example's mutation fails at its first ctx.spam.check. Name the two calls that cannot run locally, the one Gravatar call that can, and the local transaction boundary. --- comments/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/comments/README.md b/comments/README.md index 2623d4b..dd579d2 100644 --- a/comments/README.md +++ b/comments/README.md @@ -9,6 +9,18 @@ sf dev sf publish ``` +## What `sf dev` cannot show you + +`sf dev` brokers no platform services, so `addComment` stops at its first +`ctx.spam.check` call with `zero_spam_unavailable`, and `ctx.email.send` would +fail the same way with `zero_email_unavailable`. Posting a comment locally +needs those two calls guarded, or a published Space. `ctx.gravatar.avatarUrl` +is fine offline: it is a hash and a query string, not a request. + +The local transaction boundary is also the whole invocation rather than the +`ctx.transaction()` block, so use a published Space to check that the comment +row and the email outbox row really commit together. + The mutation does not call `ctx.invalidate("comments")`. A successful table write already causes live queries to refresh; explicit invalidation only narrows which named subscriptions refresh. From f17d3f6a01b69c0fd07111a45f4ffbde5a2fa095 Mon Sep 17 00:00:00 2001 From: batuhan Date: Wed, 26 Aug 2026 22:37:54 +0000 Subject: [PATCH 2/2] Say which call actually blocks a local comment ctx.email.send sits behind if (from && notify) and the two email variables are unset by default, so guarding the spam check alone is enough. Naming both sent readers after an unreachable call. --- comments/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/comments/README.md b/comments/README.md index dd579d2..185fd68 100644 --- a/comments/README.md +++ b/comments/README.md @@ -12,10 +12,12 @@ sf publish ## What `sf dev` cannot show you `sf dev` brokers no platform services, so `addComment` stops at its first -`ctx.spam.check` call with `zero_spam_unavailable`, and `ctx.email.send` would -fail the same way with `zero_email_unavailable`. Posting a comment locally -needs those two calls guarded, or a published Space. `ctx.gravatar.avatarUrl` -is fine offline: it is a hash and a query string, not a request. +`ctx.spam.check` call with `zero_spam_unavailable`. Guarding that one call is +enough to post a comment locally, because `ctx.email.send` sits behind +`if (from && notify)` and the two email variables are unset by default. Set +them and it fails the same way, with `zero_email_unavailable`. +`ctx.gravatar.avatarUrl` is fine offline: it is a hash and a query string, not +a request. The local transaction boundary is also the whole invocation rather than the `ctx.transaction()` block, so use a published Space to check that the comment