|
72168
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 23 minutes ago
LakyLak
LakyLak
commented
23 minutes ago
23 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 11 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
11 minutes ago
11 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 10 minutes ago
LakyLak
LakyLak
commented
10 minutes ago
10 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 10 minutes ago โข
github-actions
github-actions
Bot
commented
10 minutes ago
10 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72168
|
|
72169
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 23 minutes ago
LakyLak
LakyLak
commented
23 minutes ago
23 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 11 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
11 minutes ago
11 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 10 minutes ago
LakyLak
LakyLak
commented
10 minutes ago
10 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 10 minutes ago โข
github-actions
github-actions
Bot
commented
10 minutes ago
10 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72169
|
|
72170
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 23 minutes ago
LakyLak
LakyLak
commented
23 minutes ago
23 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 11 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
11 minutes ago
11 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 10 minutes ago
LakyLak
LakyLak
commented
10 minutes ago
10 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 10 minutes ago โข
github-actions
github-actions
Bot
commented
10 minutes ago
10 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info
-level diagnostics is no longer needed.
--- ยท Branch:
JY-20891-fix-alias-mismatch-on-sms-text-relay
JY-20891-fix-alias-mismatch-on-sms-text-relay
Add or remove reactions
This branch has not been deployed
This branch has not been deployed
No deployments
Merge info
Merge info
Review required
Review required
At least 1 approving review is required by reviewers with write access.
All checks have passed
All checks have passed
12 successful checks...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72170
|
|
72171
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 23 minutes ago
LakyLak
LakyLak
commented
23 minutes ago
23 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 11 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
11 minutes ago
11 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 10 minutes ago
LakyLak
LakyLak
commented
10 minutes ago
10 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 10 minutes ago โข
github-actions
github-actions
Bot
commented
10 minutes ago
10 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72171
|
|
72177
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 24 minutes ago
LakyLak
LakyLak
commented
24 minutes ago
24 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 12 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
12 minutes ago
12 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 11 minutes ago
LakyLak
LakyLak
commented
11 minutes ago
11 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 11 minutes ago โข
github-actions
github-actions
Bot
commented
11 minutes ago
11 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72177
|
|
72178
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 24 minutes ago
LakyLak
LakyLak
commented
24 minutes ago
24 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 12 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
12 minutes ago
12 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 11 minutes ago
LakyLak
LakyLak
commented
11 minutes ago
11 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 11 minutes ago โข
github-actions
github-actions
Bot
commented
11 minutes ago
11 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72178
|
|
72179
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 24 minutes ago
LakyLak
LakyLak
commented
24 minutes ago
24 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 12 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
12 minutes ago
12 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 11 minutes ago
LakyLak
LakyLak
commented
11 minutes ago
11 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 11 minutes ago โข
github-actions
github-actions
Bot
commented
11 minutes ago
11 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+......
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72179
|
|
72180
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 24 minutes ago
LakyLak
LakyLak
commented
24 minutes ago
24 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 12 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
12 minutes ago
12 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 11 minutes ago
LakyLak
LakyLak
commented
11 minutes ago
11 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 11 minutes ago โข
github-actions
github-actions
Bot
commented
11 minutes ago
11 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72180
|
|
72181
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 24 minutes ago
LakyLak
LakyLak
commented
24 minutes ago
24 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 12 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
12 minutes ago
12 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 11 minutes ago
LakyLak
LakyLak
commented
11 minutes ago
11 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 11 minutes ago โข
github-actions
github-actions
Bot
commented
11 minutes ago
11 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72181
|
|
72182
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 24 minutes ago
LakyLak
LakyLak
commented
24 minutes ago
24 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 12 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
12 minutes ago
12 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 11 minutes ago
LakyLak
LakyLak
commented
11 minutes ago
11 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 11 minutes ago โข
github-actions
github-actions
Bot
commented
11 minutes ago
11 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72182
|
|
72304
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
HomeFlesLateMoneSluCkcolVIChJiminny โฆ..# engineeringth general# hapoy birthdhy#iminny-bg# platform-tickets# product launches# randomt released# soha-office# suppor# thank-yous*the people of imi..nsirect messikes18. Mira5 Nikolaw VankovMStoyan TomovGalva Dimitrova. Aneliya AngelovaStovan Taney2, James Graham "Stefka StovanovaVasil VasileyLukas Kovalik yโฆB:: Anos4 Jira Cloud8 ToastRotonWindowHelp@ Describe what you are looking for*ToastADOUtFriday, May 22ndAooeeleat tor GithinoYasterchy yTonct Abe 10.00 AWHowowBwwoadd dica llowertoole conheurahon toeaude areumentsMhavsod.t hlechanged -@Nikolayloe Nooessimemanminoe.wantaShow moreAdind by Tonst for Githtsprophe.521 Undate Claude workflow to usenew eallowslloos tormh2 davs old - 1 fle chaneed โข @Nikolasan kovAdded ay Toast for GithubResolve Conflicts$12090 pipedrive officalMescaze Toast+ AasccelesconsAocory looog ceondre sservaces arioySthis->refreshHistoryPoint (Stonie):yd => shastorylo,eloken) 1ans ['pagetoken") = Spagetoken;Response = Sservice-susers history->ListUsersHistory(1a( key: "ininny.google text user')etHistoryPoint(Stopic. ShistoryResponse->historyid:toryResponse-sgetHistoryon+โ โด Side-by-side viewer1b69a config/logging.phgDo not ignore"driver" => 'errorlog"'level' = eny('L06 LEVEL", Sinfo')."oath' => storage path("logs/laravel,100')341410A700%L2*โข Tue 26 May 11:10:57+0.=002=689= 69customuolaraveio"Sf- uminnylocalhost& HS_Jocal jiminny@localhostA console (EUA console [STAGINGSELECT enatl_provider.1d, COUNT(&) as Count, GROUP_CONCAT(LO) aS 10045 A1 A41 ะฃ 66 AFROM text_relaysNHEPE enafl ncousden SA TM M1002027R6RA66662"'19e2033ed8ea6b10')GROUP BY enail_provider_idSELECT id, status, telephony_provider_id, created_atFROM activitiesWHERE id IN (80028719, 80028846)serculo eru coothecreco 0oorcoFROM text relaysWHERE id IN (32415, 32416)SELECT id, status, code, sender, recipient, created arriun TeacreayWHERE sender LTKE "Yaario,georgievx" OR sender LTKE "Xstoyan,tonovxORDER BY created.ar 0E50Dt00118SELECT id, uuid, status, code, sender, recipient, created_at, updated_atFRON textrelaysTHERE [EMAIL].8.10141c94186-4086-[CREDIT_CARD]-019SELECT DISTINCT u.id, u.enail, U.nane, u.softphone_number, COUNT(a.id) as sms_counttercorexhehRemoved the total ressanc ds tield trom the sunc comoleted loc.Cnanged tne rerusca message log back trom deoug to into levereondnwtsenysemice.ohcode Review - Uodated AssessmentBased on the user's changes, here's the current status against the original code review feedback;Implemented Correctly"Starting sync" log moved to top - 7 Still correctly placed at line 33-31t:mholtaton.sallsaaitzinaorosnntolovremono.ouket3. Message IDs capped - Still limited to first 10 items with array slice(Smessapeids, e, 10User Reverted Changes1. total_nessage_ids field removed - User removed this field from sync completed logZ. Retused message log level - User changed back from debua to intocurrent State vs Oriainal RevieworcinslPewiaw Pacommandationeโข* Move sync start log to top (IMPLEMENTEDX Change refused message to debug (REVERTED to info)AKduunnAVL?1ditterence"driver' a> 'errorlog"'level' => env('LOG LEVEL', Sinfo')"path' => storage oath('logs/Maravel,100')"custon channel' => lfi"pach => storage_pathttogs/custon.log)'level' => env('LOG LEVEL', Sinfo")UTE-R OuAenod...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72304
|
|
72305
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 33 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
33 minutes ago
33 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 33 minutes ago
LakyLak
LakyLak
commented
33 minutes ago
33 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 32 minutes ago โข
github-actions
github-actions
Bot
commented
32 minutes ago
32 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72305
|
|
72306
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 33 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
33 minutes ago
33 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 33 minutes ago
LakyLak
LakyLak
commented
33 minutes ago
33 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 32 minutes ago โข
github-actions
github-actions
Bot
commented
32 minutes ago...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72306
|
|
72307
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 33 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
33 minutes ago
33 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 33 minutes ago
LakyLak
LakyLak
commented
33 minutes ago
33 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 32 minutes ago โข
github-actions
github-actions
Bot
commented
32 minutes ago
32 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72307
|
|
72308
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST https://api.hubapi.com/crm/v3/objects/contact/search` resulted in a `429 Too Many Requests` response: {"status":"error","message":"You have reached your secondly limit.","errorType":"RATE_LIMIT
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST https://api.hubapi.com/crm/v3/objects/contact/search` resulted in a `429 Too Many Requests` response: {"status":"error","message":"You have reached your secondly limit.","errorType":"RATE_LIMIT
New Tab
New Tab
Comparing master...JY-20891-fix-alias-mismatch-on-sms-text-relay ยท jiminny/app
Comparing master...JY-20891-fix-alias-mismatch-on-sms-text-relay ยท jiminny/app
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
New Tab
Customize sidebar
Open Google Gemini (โX)
Tabs from other devices
Open history (โงโH)
Open bookmarks (โB)...
|
Firefox
|
Comparing master...JY-20891-fix-alias-mismatch-on- Comparing master...JY-20891-fix-alias-mismatch-on-sms-text-relay ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72308
|
|
72309
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 33 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
33 minutes ago
33 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 33 minutes ago
LakyLak
LakyLak
commented
33 minutes ago
33 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 32 minutes ago โข
github-actions
github-actions
Bot
commented
32 minutes ago
32 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72309
|
|
72310
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 33 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
33 minutes ago
33 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 33 minutes ago...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72310
|
|
72358
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 51 minutes ago
LakyLak
LakyLak
commented
51 minutes ago
51 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 39 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
39 minutes ago
39 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 39 minutes ago
LakyLak
LakyLak
commented
39 minutes ago
39 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 38 minutes ago โข
github-actions
github-actions
Bot
commented
38 minutes ago
38 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72358
|
|
72359
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 51 minutes ago
LakyLak
LakyLak
commented
51 minutes ago
51 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 39 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
39 minutes ago
39 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 39 minutes ago
LakyLak
LakyLak
commented
39 minutes ago
39 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 38 minutes ago โข
github-actions
github-actions
Bot
commented
38 minutes ago
38 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72359
|
|
72360
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 51 minutes ago
LakyLak
LakyLak
commented
51 minutes ago
51 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 39 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
39 minutes ago
39 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 39 minutes ago
LakyLak
LakyLak
commented
39 minutes ago
39 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 38 minutes ago โข
github-actions
github-actions
Bot
commented
38 minutes ago
38 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72360
|
|
72361
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72361
|
|
72362
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72362
|
|
72363
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72363
|
|
72364
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72364
|
|
72365
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72365
|
|
72366
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72366
|
|
72367
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72367
|
|
72368
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 40 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
40 minutes ago
40 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72368
|
|
72369
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 52 minutes ago
LakyLak
LakyLak
commented
52 minutes ago
52 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 41 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
41 minutes ago
41 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 39 minutes ago โข
github-actions
github-actions
Bot
commented
39 minutes ago
39 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72369
|
|
72370
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 53 minutes ago
LakyLak
LakyLak
commented
53 minutes ago
53 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 41 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
41 minutes ago
41 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 40 minutes ago
LakyLak
LakyLak
commented
40 minutes ago
40 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 40 minutes ago โข
github-actions
github-actions
Bot
commented
40 minutes ago
40 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72370
|
|
72371
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 53 minutes ago
LakyLak
LakyLak
commented
53 minutes ago
53 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 41 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
41 minutes ago
41 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 41 minutes ago
LakyLak
LakyLak
commented
41 minutes ago
41 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 40 minutes ago โข
github-actions
github-actions
Bot
commented
40 minutes ago
40 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72371
|
|
72372
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 53 minutes ago
LakyLak
LakyLak
commented
53 minutes ago
53 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 41 minutes ago
LakyLak
LakyLak
commented
41 minutes ago
41 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 40 minutes ago โข
github-actions
github-actions
Bot
commented
40 minutes ago
40 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72372
|
|
72373
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 41 minutes ago
LakyLak
LakyLak
commented
41 minutes ago
41 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 40 minutes ago โข
github-actions
github-actions
Bot
commented
40 minutes ago
40 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness)....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72373
|
|
72374
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 41 minutes ago
LakyLak
LakyLak
commented
41 minutes ago
41 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 41 minutes ago โข
github-actions
github-actions
Bot
commented
41 minutes ago
41 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72374
|
|
72375
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 42 minutes ago
LakyLak
LakyLak
commented
42 minutes ago
42 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 41 minutes ago โข
github-actions
github-actions
Bot
commented
41 minutes ago
41 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72375
|
|
72376
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 42 minutes ago
LakyLak
LakyLak
commented
42 minutes ago
42 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 41 minutes ago โข
github-actions
github-actions
Bot
commented
41 minutes ago
41 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72376
|
|
72377
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 42 minutes ago
LakyLak
LakyLak
commented
42 minutes ago
42 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 41 minutes ago โข
github-actions
github-actions
Bot
commented
41 minutes ago
41 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info
-level diagnostics is no longer needed.
--- ยท Branch:
JY-20891-fix-alias-mismatch-on-sms-text-relay
JY-20891-fix-alias-mismatch-on-sms-text-relay
Add or remove reactions
@LakyLak
JY-20891
JY-20891
code review suggestions
code review suggestions
8 / 10 checks OK
cf76b69
cf76b69
@LakyLak...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72377
|
|
72378
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 42 minutes ago
LakyLak
LakyLak
commented
42 minutes ago
42 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 41 minutes ago โข
github-actions
github-actions
Bot
commented
41 minutes ago
41 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72378
|
|
72379
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 54 minutes ago
LakyLak
LakyLak
commented
54 minutes ago
54 minutes ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 42 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
42 minutes ago
42 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 42 minutes ago
LakyLak
LakyLak
commented
42 minutes ago
42 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 41 minutes ago โข
github-actions
github-actions
Bot
commented
41 minutes ago
41 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72379
|
|
72380
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 43 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
43 minutes ago
43 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 43 minutes ago
LakyLak
LakyLak
commented
43 minutes ago
43 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 42 minutes ago โข
github-actions
github-actions
Bot
commented
42 minutes ago
42 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72380
|
|
72381
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 43 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
43 minutes ago
43 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 43 minutes ago
LakyLak
LakyLak
commented
43 minutes ago
43 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 42 minutes ago โข
github-actions
github-actions
Bot
commented
42 minutes ago
42 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72381
|
|
72382
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 43 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
43 minutes ago
43 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 43 minutes ago
LakyLak
LakyLak
commented
43 minutes ago
43 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 42 minutes ago โข
github-actions
github-actions
Bot
commented
42 minutes ago
42 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72382
|
|
72383
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 43 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
43 minutes ago
43 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 43 minutes ago
LakyLak
LakyLak
commented
43 minutes ago
43 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 42 minutes ago โข
github-actions
github-actions
Bot
commented
42 minutes ago
42 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info
-level diagnostics is no longer needed.
--- ยท Branch:
JY-20891-fix-alias-mismatch-on-sms-text-relay
JY-20891-fix-alias-mismatch-on-sms-text-relay
Add or remove reactions
@LakyLak
JY-20891
JY-20891
code review suggestions
code review suggestions...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72383
|
|
72384
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 44 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
44 minutes ago
44 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 44 minutes ago
LakyLak
LakyLak
commented
44 minutes ago
44 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 43 minutes ago โข
github-actions
github-actions
Bot
commented
43 minutes ago
43 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72384
|
|
72385
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 44 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
44 minutes ago
44 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 44 minutes ago
LakyLak
LakyLak
commented
44 minutes ago
44 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 43 minutes ago โข
github-actions
github-actions
Bot
commented
43 minutes ago
43 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice....
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72385
|
|
72386
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 44 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
44 minutes ago
44 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 44 minutes ago
LakyLak
LakyLak
commented
44 minutes ago
44 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 43 minutes ago โข
github-actions
github-actions
Bot
commented
43 minutes ago
43 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info
-level diagnostics is no longer needed.
--- ยท Branch:
JY-20891-fix-alias-mismatch-on-sms-text-relay...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72386
|
|
72387
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 44 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
44 minutes ago
44 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 44 minutes ago
LakyLak
LakyLak
commented
44 minutes ago
44 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 43 minutes ago โข
github-actions
github-actions
Bot
commented
43 minutes ago
43 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72387
|
|
72388
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 45 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
45 minutes ago
45 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 44 minutes ago โข
github-actions
github-actions
Bot
commented
44 minutes ago
44 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info
-level diagnostics is no longer needed.
--- ยท Branch:
JY-20891-fix-alias-mismatch-on-sms-text-relay
JY-20891-fix-alias-mismatch-on-sms-text-relay
Add or remove reactions...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72388
|
|
72389
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 45 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
45 minutes ago
45 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 44 minutes ago โข
github-actions
github-actions
Bot
commented
44 minutes ago
44 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning
while a plain mismatch uses
info
. The missing-header case is arguably less serious than mismatch (legitimate Gmail messages always have the header โ its absence likely indicates malformed/spam mail, not a config bug). Swapping or aligning the levels would help triage.
๐ข Nice things
๐ข Nice things
Case-insensitive host/alias comparison via
strcasecmp
โ good defensive choice.
The new test
testIsForCurrentEnvironmentRejectsWrongHostWithMatchingPlusTag
covers the cross-env confusion case (correct alias, wrong host) which is exactly the kind of edge you want pinned down.
Datasets for the matching/non-matching providers were extended with plus-tag variants โ good regression coverage.
Sentry is still being notified on exceptions; only adding logs, not replacing existing observability.
Verdict
Verdict
The functional fix is solid and addresses the Jira root cause. The blockers I'd want resolved before tagging "done" are the duplicate test (#1) and the test comments / strict mock counts (#6, #7). The logging cleanups (#2, #3, #4) are quality-of-life improvements once the immediate triage value of
info
-level diagnostics is no longer needed.
--- ยท Branch:
JY-20891-fix-alias-mismatch-on-sms-text-relay
JY-20891-fix-alias-mismatch-on-sms-text-relay
Add or remove reactions
@LakyLak
JY-20891
JY-20891
code review suggestions
code review suggestions
8 / 10 checks OK...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72389
|
|
72390
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
New Tab
New Tab
Login - SonarQube Cloud
Login - SonarQube Cloud
What's New in Firefox 151 โ Firefox.com
What's New in Firefox 151 โ Firefox.com
New Tab
New Tab
[JY-20814] Release unused Twilio numbers on Production - Jira
[JY-20814] Release unused Twilio numbers on Production - Jira
SevenShores\Hubspot\Exceptions\BadRequest: Client error: `POST [URL_WITH_CREDENTIALS]
Show options
LakyLak commented 1 hour ago
LakyLak
LakyLak
commented
1 hour ago
1 hour ago
JIRA: JY-20891
JIRA:
JY-20891
JY-20891
Changes:
Changes:
change environment check
add logs
Add or remove reactions
@LakyLak
JY-20891
JY-20891
fix alias mismatch in text relay service
fix alias mismatch in text relay service
12 / 12 checks OK
a722028
a722028
@sonarqubecloud
Show options
sonarqubecloud Bot commented 45 minutes ago
sonarqubecloud
sonarqubecloud
Bot
commented
45 minutes ago
45 minutes ago
Quality Gate Passed Quality Gate passed
Quality Gate Passed
Quality Gate passed
Issues
0 New issues
0 New issues
0 Accepted issues
0 Accepted issues
Measures
0 Security Hotspots
0 Security Hotspots
85.4% Coverage on New Code
85.4% Coverage on New Code
0.0% Duplication on New Code
0.0% Duplication on New Code
See analysis details on SonarQube Cloud
See analysis details on SonarQube Cloud
Add or remove reactions
@LakyLak
Show options
Author
LakyLak commented 45 minutes ago
LakyLak
LakyLak
commented
45 minutes ago
45 minutes ago
@claude
@claude
Add or remove reactions
react with eyes
๐
1
@github-actions
Show options
github-actions Bot commented 44 minutes ago โข
github-actions
github-actions
Bot
commented
44 minutes ago
44 minutes ago
โข
edited
edited
Claude finished
@LakyLak
@LakyLak
's task in 2m 46s
โโ
View job
View job
๐
Jira:
JY-20891 โ Sidekick SMS issue
JY-20891 โ Sidekick SMS issue
Status:
Deployed
| Requirements were found in the Jira ticket and are included below.
๐ค
Model:
claude-opus-4-7
Jira Ticket Requirements Coverage
Jira Ticket Requirements Coverage
Requirement
Status
Notes
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
โ
Implemented
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
Explain why senders always receive the "failure" email even when the message was actually sent
โ ๏ธ
Partial
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
โ
Implemented
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
โ Out of scope
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Requirement
Find why valid SMS replies (e.g. Scott's reply to
[PHONE]
) were silently dropped and never reached Twilio
Explain why senders always receive the "failure" email even when the message was actually sent
Investigate trace gap (no CloudWatch / Twilio / Sentry record of the attempted send)
Verify segmentation / long-SMS suspicion (email signature blowing up message size)
Status
โ
Implemented
โ ๏ธ
Partial
โ
Implemented
โ Out of scope
Notes
Root cause is the strict equality on
X-Gm-Original-To
. Inbound emails arrive with a Gmail-style plus tag (e.g.
[EMAIL]
) which never equals the expected
[EMAIL]
, so the message is silently refused. The new
matchesExpectedRecipient
strips the
+...
suffix before comparing.
The PR doesn't change the failure-email path itself. The implicit hypothesis is: the same alias mismatch caused
isForCurrentEnvironment
to refuse the relay, hence no Twilio send, hence the failure email. The PR should fix that root cause, but the failure-email producer (likely in
EmailTextRelay
job / Twilio webhook path) is not touched here โ worth confirming nothing else can still produce a false failure email after the fix lands.
The added
Log::info/warning/error
calls in
sync
,
getHistory
, and
isForCurrentEnvironment
close that gap going forward โ refused messages, missing headers, and Gmail API errors are now logged with the
message_id
.
This PR doesn't touch SMS segmentation. Once the alias fix is in prod, you'll be able to see in logs whether messages were refused vs. actually sent to Twilio; that should rule signature/length in or out.
Code Review
Code Review
โ
Core fix is correct
โ
Core fix is correct
app/Services/Mail/TextRelayService.php:211-222
โ
matchesExpectedRecipient
correctly:
Splits the host with a 2-arg
explode
(safe against
a@b@c
weirdness)
Compares the host case-insensitively
Strips the
+...
plus-tag from the local part before comparing the alias
This squarely addresses the reported failure (plus-tagged recipients silently refused).
๐ก Issues / suggestions
๐ก Issues / suggestions
testSyncWithRefusedMessageLogs
is a verbatim copy of
testSyncWithEnhancedLogging
โ
tests/Unit/Services/Mail/TextRelayServiceTest.php:336-420
. Both set EU region, mock
getHistory
to return
[]
, and expect the same start/completed
Log::info
calls. Neither actually exercises a refused message. Either delete the duplicate or make it return a history containing a non-matching
X-Gm-Original-To
and assert the
Refused message
log.
Fix this โ
Fix this โ
Log::info('[TextRelayService] Refused message', ...)
fires for every refused message
(
TextRelayService.php:187-191
). If inbound mail for EU and US share the same inbox (which seems to be the design โ each env filters by alias), this will produce one info log per cross-region message every sync. Suggest dropping it to
debug
, or rate-limiting it after the immediate investigation, otherwise the diagnostic value drowns in noise quickly.
Log::info('[TextRelayService] Starting sync', ...)
fires after
getService()
and
getHistory()
(
TextRelayService.php:33-41
). If either throws (e.g. credentials missing, Gmail history call fails before the
try
), the "Starting sync" log never appears โ exactly when you'd want it. Move it to the very top of
sync()
, right after computing the alias/host.
"Sync completed" log includes the full
message_ids
array
(
TextRelayService.php:77-81
). On busy syncs this can be a large payload.
messages_processed
is usually enough; keep
message_ids
only at
debug
, or cap the list.
'original_to' => $header->value
in the refused-message log
(
TextRelayService.php:189
) embeds the plus-tag, which encodes a phone number and Twilio routing hash. That's borderline PII. If this log is shipped to a third-party sink (e.g. Datadog) verify your data-classification policy allows it.
Test comments violate CLAUDE.md
("Do not add comments unless it's a weird quirk").
TextRelayServiceTest.php:343,346,349,366,386,389,392,409
โ all 8
//
comments are restating obvious code (
// Mock getHistory to return empty array
,
// Mock Sentry to prevent actual error reporting
, etc.). Please strip them.
\Sentry::shouldReceive('captureException')->zeroOrMoreTimes()
in
testSyncWithEnhancedLogging
/
testSyncWithRefusedMessageLogs
violates CLAUDE.md "Do not use
$this->any()
, always use the exact number of times". Since neither test exercises an error path, this should be
->never()
(or just omit and rely on Mockery's default strict-ness).
testSyncWithEnhancedLogging
doesn't really assert anything new
beyond "two log lines fire on an empty sync." Consider replacing it (rather than duplicating) with a test that walks a non-empty history end-to-end (
getHistory
โ matching
X-Gm-Original-To
โ dispatched job โ "Successfully dispatched message" log). That's where the real regression risk is, and it's currently uncovered.
Minor โ log message wording
:
'[TextRelayService] Refused message: missing X-Gm-Original-To header'
(
TextRelayService.php:197
) uses
warning...
|
Firefox
|
JY-20891 fix alias mismatch in text relay service JY-20891 fix alias mismatch in text relay service by LakyLak ยท Pull Request #12128 ยท jiminny/app โ Work...
|
github.com/jiminny/app/pull/12128
|
72390
|