73a8a95
test(webhook): failed emits correct stream event
Phillip Davis created
73a8a95
test(webhook): failed emits correct stream event
Phillip Davis created
2d25c26
test(webhook): delivered stream event
Phillip Davis created
76eadf1
test(webhook): unknown dir failed returns 400
Phillip Davis created
4b00d69
test(webhook): unknown dir non-failed returns 400
Phillip Davis created
b421077
test(webhook): unknown outbound returns 200
Phillip Davis created
95a2e54
test(webhook): outbound unregistered returns 403
Phillip Davis created
7b11bf0
test(webhook): failure sends one error
Phillip Davis created
8c4a9ba
test(webhook): multi-to outbound no receipts
Phillip Davis created
d2f3b02
test(webhook): delivery sends one receipt
Phillip Davis created
36cd02e
refactor: move common setup code to test_helper
Phillip Davis created
d13029c
test: groundwork for property tests
- some extra generators for domain-specific data like NANPA-compliant phone numbers, Bandwidth media URLs, and JIDs (could be better, but nobody's perfect) - Rake test tasks split into `unit` and `property` (existing `test` target runs both and is still the default) - `property` target picks a random seed, then uses that seed to set `--seed=` (for minitest) and `srand` (for rantly). downside: you can only seed a whole test, you can rerun just one property with the same generated input. sad. - `rake property` will, by default, collect failing seeds into `test/stubs`
Phillip Davis created
5803d8e
fix: REALLY set ARGV[0] in all tests
turns out you need to set it in both test_helper and in em - sgx_bwmsgsv2 references ARGV[0], so must set it before requiring - but each test runs in its own fiber, and fibers don't share ARGV
Phillip Davis created
a1960e5
fix: require 'delegate'
fails, at least under ruby 3, without this
Phillip Davis created
93eae50
test(webhook): nil text with no media returns 400
Phillip Davis created
112b8da
fix(webhook): reject empty body with no media
When text is empty/nil and there is no media, return 400 instead of falling through to message construction with nil text.
Phillip Davis created
1ebdee3
test(webhook): single recipient with media stanza
Phillip Davis created
13a2150
test(webhook): group stanza has addresses element
Phillip Davis created
195e838
fix(webhook): reject empty recipients with 400
When jparams['to'] is an empty array, return 400 instead of falling through to message construction.
Phillip Davis created
7315bef
test(webhook): single recipient text stanza shape
Phillip Davis created
d8115f1
test(webhook): unregistered JID writes no stanza
When the webhook references a phone number with no Redis JID mapping, the handler returns 403 and writes no XMPP stanza.
Phillip Davis created
3ec27f7
test(webhook): empty params writes no stanza
Phillip Davis created
0344971
refactor: put webhook tests in their own file
Phillip Davis created
0ade5d1
apply-hotfix: amend msg fallback logic
Phillip Davis created
7e4ceb6
apply-hotfix: early exit for some inbound
Phillip Davis created
c4a5a62
apply-hotfix: dont add empty text bodies
Phillip Davis created
628ed0d
apply-hotfix: relocate deduplication of group msgs
Phillip Davis created
3dfa8c7
apply-hotfix: shuffle handling of message-failed
this does not change any functionality, it removes a case where we initially lie about which values is `others_num`
Phillip Davis created
e9249f4
remove inactive `case jparams['type']` branches
these types do not exist in V2, which can be verified either by the reading the bandwidth docs here[0] or by reading the commit message of cd6e0df [0]: https://dev.bandwidth.com/docs/messaging/webhooks/#inbound-message-webhooks
Phillip Davis created
46e6b93
remove pry-stack_explorer
pry-byebug explicitly says that pry-stack_explorer is incompatible
Phillip Davis created
d16f235
enhancement: -j/--json flag
Phillip Davis created
782205a
backport: dont run handlers after message :error?
Phillip Davis created
e5254af
Merge branch 'emit-resends-as-resends' of https://git.secluded.site/sgx-bwmsgsv2
* 'emit-resends-as-resends' of https://git.secluded.site/sgx-bwmsgsv2: Emit ResendIn event when replaying inbound messages
Stephen Paul Weber created
0d3b089
Merge branch 'incorporate-first-round-of-hotfixes' of https://git.secluded.site/sgx-bwmsgsv2
* 'incorporate-first-round-of-hotfixes' of https://git.secluded.site/sgx-bwmsgsv2: fix: make sure ARGV[0] is set for all tests fix: don't call `from=` on StanzaError fix: Message::Base.media_urls is always an array fix: correct for dedup in message event fix: webhook tests need to stub component's `write` fix: webhooks expect top-level 'to' fix: response_handler wants unescaped strings fix: don't stop reactor if test
Stephen Paul Weber created
d5b108f
Add event viewer script
Amolith created
6ed61f9
Emit ResendIn event when replaying inbound messages
Add a ResendIn message event type that records the original stream ID and bandwidth ID without duplicating body or media fields. The webhook handler emits this event instead of a normal In event when the X-JMP-Resend header is present.
Amolith created
980b24a
fix: make sure ARGV[0] is set for all tests
Phillip Davis created
b773ad3
fix: don't call `from=` on StanzaError
Phillip Davis created
78c4b9c
fix: Message::Base.media_urls is always an array
Phillip Davis created
851699e
fix: correct for dedup in message event
Phillip Davis created
234b65f
fix: webhook tests need to stub component's `write`
Phillip Davis created
e87a1cc
fix: webhooks expect top-level 'to'
Phillip Davis created
d49eae1
fix: response_handler wants unescaped strings
except we also unescape each individual tag part?
Phillip Davis created
1ea7964
fix: don't stop reactor if test
each test runs on its own reactor. stopping it means that `assert`s are never called, which meant that gateway shutdown was counted as test success. no bueno!
Phillip Davis created
34f259b
Add resend-inbounds script for replaying messages from Redis
Amolith created
d51ed18
Fix editorconfig
Stephen Paul Weber created
eebff0f
pin blather to better-ids branch
includes the same fix as better-feature-order
Phillip Davis created
ace95df
Add .gitignore
Phillip Davis created
cecd219
Add .editorconfig
so I stop accidentally blowing it away
Phillip Davis created
8bba5ad
fix: monkeypatch URI.escape, for now
pending bigger move to newer Ruby version which supports Gems that don't rely on old, broken APIs from the stdlib
Phillip Davis created
68a0ab4
Merge branch 'catch-errors-from-at-least-bandwidth' of https://git.secluded.site/sgx-bwmsgsv2
* 'catch-errors-from-at-least-bandwidth' of https://git.secluded.site/sgx-bwmsgsv2: Adopt cmd error handling like sgx-jmp
Stephen Paul Weber created