Migrate IWF endpoint clients to account-scoped lambda with feature flag toggle#3938
Open
Migrate IWF endpoint clients to account-scoped lambda with feature flag toggle#3938
Conversation
…h account-scoped lambda support Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate client code to account-scoped lambda endpoints
Migrate IWF endpoint clients to account-scoped lambda with feature flag toggle
Feb 19, 2026
stephenhand
requested changes
Feb 20, 2026
Collaborator
stephenhand
left a comment
There was a problem hiding this comment.
@copilot import references in the unit tests for the iwf endpoints are still pointing at their old location in ServerlessService.ts, causing them to fail
Update the import directives to point to the new location
…erlessService Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Contributor
Author
Fixed in 5a534f1 — updated the import and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates
reportToIWFandselfReportToIWFfromServerlessService.tsinto a dedicatediwfService.ts, adding ause_twilio_lambda_for_iwf_reportingflag to route calls to either the legacy serverless endpoints or the new account-scoped lambda (/integrations/iwf/reportToIWF,/integrations/iwf/selfReportToIWF).Description
Key changes
FeatureFlags.ts— New flaguse_twilio_lambda_for_iwf_reportingfollowing the establisheduse_twilio_lambda_*convention.iwfService.ts(new) — HousesreportToIWFandselfReportToIWF. When the flag is on, routes to the lambda endpoints withuseTwilioLambda: true. Normalises thereportToIWFlambda response ({ status, data }wrapper → unwrap todata) so callers are unaffected.selfReportToIWFneeds no normalisation — the lambda already returns{ reportUrl, status }directly.ServerlessService.ts— IWF functions and their now-unused type imports removed.csamReportApi.ts— Import updated fromServerlessService→iwfService.csamReportApi.test.ts— Updated import andjest.mockreferences fromServerlessServicetoiwfServiceso the existing tests correctly mock the new service location.Checklist
Other Related Issues
None
Verification steps
use_twilio_lambda_for_iwf_reporting: false— confirm CSAM counsellor and child self-report flows hit the serverless endpoints as before.use_twilio_lambda_for_iwf_reporting: true— confirm the same flows route to the account-scoped lambda (/integrations/iwf/reportToIWF,/integrations/iwf/selfReportToIWF) and complete successfully.AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.