0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/docs
Régis Hanol e27a3a4542
DEV: Fill defaulted keyword arguments in service runner blocks (#42264)
Previously, a `Service::Runner` action block could declare a keyword
argument with a default (e.g. `on_success do |table_sizes: {}|`), but
the runner only fills **required** keyword arguments from the service
result — so the default always won and the service's computed value was
silently dropped, producing 200 responses with subtly wrong data (see
#42263 where this happened twice in the workflows plugin).

Following review feedback, instead of raising on defaulted keyword
arguments (the initial approach), the runner now fills them from the
result exactly like required ones. The default only applies when the
service didn't set the key at all, making it a proper fallback for keys
that are only set on some paths — a model fetched by a step that didn't
run, or steps wrapped in an `only_if` block. This matters for outcome
blocks in particular, since the caller (possibly a plugin) doesn't
always own the service it calls and can't make it always set a key.

Also documents required vs defaulted keyword arguments in the service
objects developer guide.
2026-08-03 17:31:37 +02:00
..
developer-guides DEV: Fill defaulted keyword arguments in service runner blocks (#42264) 2026-08-03 17:31:37 +02:00
ADMIN-QUICK-START-GUIDE.md fix emojis (#34411) 2025-08-19 11:25:20 +02:00
AUTHORS.md
code-of-conduct.md
INSTALL-cloud.md DOCS: Mention updated plan names in INSTALL-cloud.md (#41618) 2026-07-14 16:48:46 +05:30
INSTALL-email.md DOCS: Update Brevo's SMTP config (#38770) 2026-03-24 09:09:07 +01:00
INSTALL.md DOCS: amend documented required PostgreSQL version (#37931) 2026-02-24 17:20:04 +11:00
PLUGINS.md UX: update category references in documentation to match meta changes (#41263) 2026-06-29 11:33:49 -04:00
SECURITY.md FEATURE: Increase pbkdf2 iterations to 600k (#20981) 2023-04-11 11:56:20 +01:00
TESTING.md DEV: replace mailcatcher references with mailhog (#14500) 2021-10-05 15:48:06 +05:30