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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3568759074455238e0addc957d2b46db3616a26057eb4d1fdd8ec70c1be577c7
4
- data.tar.gz: c31228426dfa4dbbcb49ab5df47662104e1d91100e2a92040f699ce92b09db7a
3
+ metadata.gz: 842a9a2d8d24afbb8e0444d995ea6c1d8707ec5fc2c9a40405d40f71b46495b8
4
+ data.tar.gz: 8e54c583a6bf251818144b2ae6e1589197b4b0153093e0dd36048798a696346a
5
5
  SHA512:
6
- metadata.gz: 54e3ecd41d651aa918809f247799e00edcb79ad5da331ad2b33f669b3bdb989b727b4cb3cf39f8e1150c9778ca4326084cc7d8c31994ab0c2e5c04b82247833a
7
- data.tar.gz: fbb24fcacd678d5ad060d4e1ce772c646aed2ff61bcaaa232be42903eee416965cd06b9eab7b4f2f68b1980272ed059fd4e216e78c8896b77741bdf1d3377d69
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parse-stack-next (5.4.0)
4
+ parse-stack-next (5.4.1)
5
5
  activemodel (>= 6.1, < 9)
6
6
  activesupport (>= 6.1, < 9)
7
7
  connection_pool (>= 2.2, < 4)
@@ -6,6 +6,6 @@ module Parse
6
6
  # The Parse Server SDK for Ruby
7
7
  module Stack
8
8
  # The current version.
9
- VERSION = "5.4.0"
9
+ VERSION = "5.4.1"
10
10
  end
11
11
  end
@@ -454,7 +454,7 @@ module Parse
454
454
  end
455
455
  end
456
456
 
457
- if type == :after_save && (result == true || result.nil?) && payload&.parse_object.present? && payload.parse_object.is_a?(Parse::Object)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parse-stack-next
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 5.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Curtin