Repository navigation
Add inbound reply simulation - #1
Merged
Merged
Conversation
Lets a dev type a reply in the SmsTrap UI and trigger the host app's real inbound-webhook path via SmsTrap.reply_handler, a bare callable the host app configures (mirrors Connector's provider-agnostic shape on the outbound side). The reply form only renders when a handler is configured, so outbound-only apps see no dead UI; reading reply_handler unset raises ReplyHandlerNotConfigured. Also fixes test/dummy's show_exceptions config: Rails 7.2 only treats the symbol :none as "raise instead of render" — the generated boolean false was silently swallowing exceptions in integration tests.
rreinhardt9
force-pushed
the
cp-15686-inbound-reply-simulation
branch
from
September 21, 2026 20:12
a73aa5e to
36ced27
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SmsTrap.reply_handler— a bare callable (#call(from:, to:, text:)) the host app configures in a dev-only initializer to trigger its real inbound-webhook path when a dev submits a reply in the UI. Kept provider-agnostic and symmetric withConnector's outbound shape —sms_trapnever knows what's inside the callable.SmsTrap.reply_handler?is true — apps that never need inbound simulation see no dead/disabled UI. Readingreply_handlerunset raisesSmsTrap::ReplyHandlerNotConfigured(loud, immediate, no silent no-op — matches the gem's existing style).Incidental fix
test/dummy/config/environments/test.rbhadconfig.action_dispatch.show_exceptions = false(a boolean). Rails 7.2'sExceptionWrapper#show?only treats the literal symbol:noneas "raise instead of render" — the boolean silently fell through to the render branch, swallowing exceptions that integration tests expect to propagate viaassert_raises. Fixed to:none, matching the file's own comment ("Raise exceptions instead of rendering exception templates").Test plan
bin/rails test— 18 runs, 0 failuresbundle exec rubocop— clean