Skip to content

Fix after_save webhook callback handling#16

Merged
AdrianCurtin merged 1 commit into
mainfrom
after_save_callback_fix
Jun 7, 2026
Merged

Fix after_save webhook callback handling#16
AdrianCurtin merged 1 commit into
mainfrom
after_save_callback_fix

Conversation

@AdrianCurtin

Copy link
Copy Markdown
Contributor

Ensure after_save webhook handlers that return a Parse::Object no longer suppress model callbacks. The change makes callback dispatch depend only on request origin (trusted Ruby-initiated saves still skip webhook callbacks; client-initiated saves always run them) and documents that the handler result is normalized to true so returned objects cannot leak into responses or logs. Bumps stack version to 5.4.1, adds a regression test for object-returning handlers, and updates the changelog.

Ensure after_save webhook handlers that return a Parse::Object no longer suppress model callbacks. The change makes callback dispatch depend only on request origin (trusted Ruby-initiated saves still skip webhook callbacks; client-initiated saves always run them) and documents that the handler result is normalized to true so returned objects cannot leak into responses or logs. Bumps stack version to 5.4.1, adds a regression test for object-returning handlers, and updates the changelog.
Copilot AI review requested due to automatic review settings June 7, 2026 15:11

Copilot AI 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.

Pull request overview

This PR fixes after_save webhook callback dispatch so that model callbacks (after_create/after_save) are no longer suppressed when an afterSave handler mistakenly returns a Parse::Object. Callback dispatch now depends only on request origin (trusted Ruby-initiated saves still suppress webhook-side callbacks to avoid double-runs; client-initiated saves always run them), and afterSave handler results are normalized to true to prevent object leakage into webhook responses/logs.

Changes:

  • Update Parse::Webhooks.call_route to run after_save model callbacks based solely on request origin, not the handler return value.
  • Add a regression test covering object-returning after_save handlers and verifying the result is normalized to true.
  • Bump version to 5.4.1 and document the fix in the changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/lib/parse/webhook_callbacks_test.rb Adds regression coverage ensuring object-returning after_save handlers still dispatch callbacks (client-initiated) and normalize return value to true.
lib/parse/webhooks.rb Removes handler-result gating for after_save callback dispatch and documents/implements result normalization to true.
lib/parse/stack/version.rb Bumps gem version from 5.4.0 to 5.4.1.
CHANGELOG.md Documents the afterSave callback suppression fix and return-value normalization behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AdrianCurtin AdrianCurtin merged commit d1779f1 into main Jun 7, 2026
12 checks passed
@AdrianCurtin AdrianCurtin deleted the after_save_callback_fix branch June 7, 2026 15:20
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.

2 participants