parse-stack-next 5.4.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/lib/parse/stack/version.rb +1 -1
- data/lib/parse/webhooks.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 842a9a2d8d24afbb8e0444d995ea6c1d8707ec5fc2c9a40405d40f71b46495b8
|
|
4
|
+
data.tar.gz: 8e54c583a6bf251818144b2ae6e1589197b4b0153093e0dd36048798a696346a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 264a5574513616b8cb9ebe662c9e1109746d688c191affe3faefd11f20b0911039f09e895e535874e8715ddf5f53b30e863f6cdc5fa54f4cafabe2f5044398db
|
|
7
|
+
data.tar.gz: d61b36d12ef78eb05b701ff1e45858c7dc2f911bd548d912db9e061fe9027fed86c3b2b2808f2a89cbeb5115c603fd279425ccec2d184f567b9ef00f8eb901af
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
## parse-stack-next Changelog
|
|
2
2
|
|
|
3
|
+
### 5.4.1
|
|
4
|
+
|
|
5
|
+
#### Webhook after_save callback fix
|
|
6
|
+
|
|
7
|
+
- **FIXED**: an `afterSave` webhook handler that returns a `Parse::Object`
|
|
8
|
+
(instead of `true` or `nil`) no longer suppresses the model's `after_create`
|
|
9
|
+
and `after_save` callbacks on client-initiated saves. Parse Server discards
|
|
10
|
+
the `afterSave` response body entirely — it resolves the request as a success
|
|
11
|
+
even when the handler raises — so the handler's return value must not gate
|
|
12
|
+
callback dispatch. The decision now depends only on the request origin: a
|
|
13
|
+
trusted Ruby-initiated save still skips the webhook-side callbacks (the local
|
|
14
|
+
`run_callbacks :save` fires them, avoiding a double-run), while a
|
|
15
|
+
client-initiated save always fires them. Returning the object — the
|
|
16
|
+
recommended `beforeSave` pattern, easy to copy into an `afterSave` by mistake
|
|
17
|
+
— previously skipped an `after_save :send_email` and similar side effects
|
|
18
|
+
silently. The result is also normalized to `true`, so a returned object can
|
|
19
|
+
no longer leak into the response body or the debug log.
|
|
20
|
+
|
|
3
21
|
### 5.4.0
|
|
4
22
|
|
|
5
23
|
#### Parse Server 8.x / 9.x compatibility fixes
|
data/Gemfile.lock
CHANGED
data/lib/parse/stack/version.rb
CHANGED
data/lib/parse/webhooks.rb
CHANGED
|
@@ -454,7 +454,7 @@ module Parse
|
|
|
454
454
|
end
|
|
455
455
|
end
|
|
456
456
|
|
|
457
|
-
if type == :after_save &&
|
|
457
|
+
if type == :after_save && payload&.parse_object.present? && payload.parse_object.is_a?(Parse::Object)
|
|
458
458
|
# Handle after_save callbacks intelligently based on request origin.
|
|
459
459
|
# For trusted-Ruby-initiated saves (both `_RB_` header AND master
|
|
460
460
|
# key), Parse Stack's local `run_callbacks :save` will fire
|
|
@@ -464,6 +464,14 @@ module Parse
|
|
|
464
464
|
# per save). For everything else -- client-initiated saves, or a
|
|
465
465
|
# spoofed `_RB_` from a non-master client -- Parse Stack never had
|
|
466
466
|
# a chance to run callbacks, so we fire them here.
|
|
467
|
+
#
|
|
468
|
+
# The decision depends ONLY on request origin, never on what the
|
|
469
|
+
# handler returned. Parse Server discards the afterSave response
|
|
470
|
+
# body entirely (it resolves {success} even if the handler throws),
|
|
471
|
+
# so a handler that returns the parse_object -- the recommended
|
|
472
|
+
# before_save pattern, easy to copy by mistake -- must NOT silently
|
|
473
|
+
# suppress these callbacks. We normalize the result to `true` below
|
|
474
|
+
# so a returned object never leaks into the response or the log.
|
|
467
475
|
is_new = payload.original.nil?
|
|
468
476
|
unless trusted_ruby_initiated
|
|
469
477
|
payload.parse_object.run_after_create_callbacks if is_new
|