The notifications worker dispatches SendVerificationCodeCommand / VerifyCodeCommand to MediatR handlers in SpikerSoft.Workers.Notifications/Handlers/. Those handlers load the Verify service SID from the wrong configuration key:
But appsettings.json (both SpikerSoft.Api and SpikerSoft.EventHandlers.Notifications) and the canonical TwilioVerifyService use Twilio:VerifyServiceSid:
"Twilio":{"VerifyServiceSid":"VA..."}
So request.VerificationServiceSid ?? _verificationServiceSid resolves to null, and both handlers short-circuit with VERIFICATION_SERVICE_NOT_CONFIGURED. This silently masks the #260 fix: the API now correctly dispatches the commands to the worker, but the worker can't find the SID and fails the send/check.
Fix
Standardize on Twilio:VerifyServiceSid (the key already present in appsettings and used by TwilioVerifyService):
Update the four unit-test config mocks that referenced the old key.
Note: the command property VerificationServiceSid and the Mongo audit field of the same name are left as-is — only the config key lookup changes.
Acceptance
With Twilio:VerifyServiceSid configured, the worker's verification send/check use the SID instead of returning VERIFICATION_SERVICE_NOT_CONFIGURED.
Backend-only change; no SPA change.
Follow-up to #260 (it called this out as adjacent cleanup).
## Problem
The notifications worker dispatches `SendVerificationCodeCommand` / `VerifyCodeCommand` to MediatR handlers in `SpikerSoft.Workers.Notifications/Handlers/`. Those handlers load the Verify service SID from the **wrong** configuration key:
```csharp
_verificationServiceSid = _configuration["Twilio:VerificationServiceSid"]; // wrong
```
But `appsettings.json` (both `SpikerSoft.Api` and `SpikerSoft.EventHandlers.Notifications`) and the canonical `TwilioVerifyService` use `Twilio:VerifyServiceSid`:
```jsonc
"Twilio": { "VerifyServiceSid": "VA..." }
```
So `request.VerificationServiceSid ?? _verificationServiceSid` resolves to **null**, and both handlers short-circuit with `VERIFICATION_SERVICE_NOT_CONFIGURED`. This silently masks the #260 fix: the API now correctly dispatches the commands to the worker, but the worker can't find the SID and fails the send/check.
## Fix
Standardize on `Twilio:VerifyServiceSid` (the key already present in appsettings and used by `TwilioVerifyService`):
- `SpikerSoft.Workers.Notifications/Handlers/SendVerificationCodeCommandHandler.cs`
- `SpikerSoft.Workers.Notifications/Handlers/VerifyCodeCommandHandler.cs`
- Update the four unit-test config mocks that referenced the old key.
Note: the command property `VerificationServiceSid` and the Mongo audit field of the same name are left as-is — only the **config key** lookup changes.
## Acceptance
- With `Twilio:VerifyServiceSid` configured, the worker's verification send/check use the SID instead of returning `VERIFICATION_SERVICE_NOT_CONFIGURED`.
- Backend-only change; no SPA change.
Follow-up to #260 (it called this out as adjacent cleanup).
Scope expanded in PR #21 after checking the deploy/env wiring: found a second gate. The worker's verify handlers check Twilio:Enabled first (defaulting to false when absent) and would return TWILIO_DISABLED before ever reaching the SID. The worker's appsettings.json Twilio block was missing Enabled (the API's has "Enabled": true).
"Enabled": true in SpikerSoft.EventHandlers.Notifications/appsettings.json Twilio block (matches the API).
Documented Twilio__Enabled in deploy/docker-stack.yml (defaults true via appsettings; set false to disable per env).
Still required at deploy time (server-side per-service stack /mnt/infrastructure/spikersoft-notifications): Twilio__AccountSid, Twilio__AuthToken, Twilio__VerifyServiceSid.
Scope expanded in PR #21 after checking the deploy/env wiring: found a second gate. The worker's verify handlers check `Twilio:Enabled` first (defaulting to `false` when absent) and would return `TWILIO_DISABLED` before ever reaching the SID. The worker's `appsettings.json` Twilio block was missing `Enabled` (the API's has `"Enabled": true`).
Added to PR #21:
- `"Enabled": true` in `SpikerSoft.EventHandlers.Notifications/appsettings.json` Twilio block (matches the API).
- Documented `Twilio__Enabled` in `deploy/docker-stack.yml` (defaults true via appsettings; set false to disable per env).
Still required at deploy time (server-side per-service stack `/mnt/infrastructure/spikersoft-notifications`): `Twilio__AccountSid`, `Twilio__AuthToken`, `Twilio__VerifyServiceSid`.
Resolved. Fixed in spikersoft-backend PR #21 (merged to master, commit ede0fa6): the worker verify handlers now read Twilio:VerifyServiceSid (matching the configured key) instead of Twilio:VerificationServiceSid. Closing.
Resolved. Fixed in spikersoft-backend PR #21 (merged to `master`, commit `ede0fa6`): the worker verify handlers now read `Twilio:VerifyServiceSid` (matching the configured key) instead of `Twilio:VerificationServiceSid`. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The notifications worker dispatches
SendVerificationCodeCommand/VerifyCodeCommandto MediatR handlers inSpikerSoft.Workers.Notifications/Handlers/. Those handlers load the Verify service SID from the wrong configuration key:But
appsettings.json(bothSpikerSoft.ApiandSpikerSoft.EventHandlers.Notifications) and the canonicalTwilioVerifyServiceuseTwilio:VerifyServiceSid:So
request.VerificationServiceSid ?? _verificationServiceSidresolves to null, and both handlers short-circuit withVERIFICATION_SERVICE_NOT_CONFIGURED. This silently masks the #260 fix: the API now correctly dispatches the commands to the worker, but the worker can't find the SID and fails the send/check.Fix
Standardize on
Twilio:VerifyServiceSid(the key already present in appsettings and used byTwilioVerifyService):SpikerSoft.Workers.Notifications/Handlers/SendVerificationCodeCommandHandler.csSpikerSoft.Workers.Notifications/Handlers/VerifyCodeCommandHandler.csNote: the command property
VerificationServiceSidand the Mongo audit field of the same name are left as-is — only the config key lookup changes.Acceptance
Twilio:VerifyServiceSidconfigured, the worker's verification send/check use the SID instead of returningVERIFICATION_SERVICE_NOT_CONFIGURED.Follow-up to #260 (it called this out as adjacent cleanup).
Scope expanded in PR #21 after checking the deploy/env wiring: found a second gate. The worker's verify handlers check
Twilio:Enabledfirst (defaulting tofalsewhen absent) and would returnTWILIO_DISABLEDbefore ever reaching the SID. The worker'sappsettings.jsonTwilio block was missingEnabled(the API's has"Enabled": true).Added to PR #21:
"Enabled": trueinSpikerSoft.EventHandlers.Notifications/appsettings.jsonTwilio block (matches the API).Twilio__Enabledindeploy/docker-stack.yml(defaults true via appsettings; set false to disable per env).Still required at deploy time (server-side per-service stack
/mnt/infrastructure/spikersoft-notifications):Twilio__AccountSid,Twilio__AuthToken,Twilio__VerifyServiceSid.Resolved. Fixed in spikersoft-backend PR #21 (merged to
master, commitede0fa6): the worker verify handlers now readTwilio:VerifyServiceSid(matching the configured key) instead ofTwilio:VerificationServiceSid. Closing.