Skip to content

Conversation

@sureshc
Copy link
Contributor

@sureshc sureshc commented Dec 11, 2025

#69880 did not work and we continue to see about 300 student requests fail each day due to connectivity issues with WebPurify.

image

This is occuring, in part, because of a latent defect in our invocation of Net::HTTP.start. We failed to add the splat (**) operator to the final CONNECTION_OPTIONS hash argument, so since upgrading to Ruby 3.x, we've been incorrectly passing it to the 3rd argument (p_addr http proxy address) https://docs.ruby-lang.org/en/3.1/Net/HTTP.html#method-c-start

Also switch to HTTPS (TLS) because we've been gifted an Enterprise license and that supports SSL and connectivity may be more reliable over HTTPS and port 443.

Testing story

Configured local development environment with an API key and manually executed many of the unit tests (which use VCR to mock interactions with the WebPurify webservice):

[development] dashboard > require 'cdo/web_purify'
=> false
[development] dashboard > WebPurify.find_potential_profanities('not a swear')
=> nil
[development] dashboard > WebPurify.find_potential_profanities('assuage')
=> nil
[development] dashboard > WebPurify.find_potential_profanities('8005555555 t')
=> nil
[development] dashboard > WebPurify.find_potential_profanities('sh1t! holy shit')
=> ["sh1t", "shit"]
[development] dashboard > WebPurify.find_potential_profanities('shitstain')
=> ["shitstain"]
[development] dashboard > WebPurify.find_potential_profanities('ass')
=> ["ass"]
[development] dashboard > WebPurify.find_potential_profanities('scheiße', ['de'])
=> ["scheiße"]
[development] dashboard > WebPurify.find_potential_profanities('puta madre', ['es'])
=> ["puta"]
[development] dashboard > WebPurify.find_potential_profanities('some mierda and some scheiße', ['es', 'de'])
=> ["mierda", "scheiße"]

Deployment strategy

Follow-up work

Implement HTTP retry for the cases where the HTTP connection pool gives us a stale connection (if we set keep-alive > 0), and for cases when the webservice has other types of connectivity errors).

Privacy

Security

Caching

PR Creation Checklist:

  • Tests provide adequate coverage
  • Privacy impacts have been documented
  • Security impacts have been documented
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Follow-up work items (including potential tech debt) are tracked and linked

@sureshc sureshc requested review from a team December 11, 2025 00:10
@sureshc sureshc marked this pull request as ready for review December 11, 2025 20:51
@sureshc sureshc changed the base branch from staging-next to staging December 11, 2025 21:10
@sureshc sureshc requested a review from a team as a code owner December 11, 2025 21:10
@sureshc sureshc changed the base branch from staging to staging-next December 11, 2025 21:11
@sureshc sureshc merged commit 1372eeb into staging-next Dec 11, 2025
3 of 4 checks passed
@sureshc sureshc deleted the infrastructure/switch-webpurify-to-https branch December 11, 2025 21:16
sureshc added a commit that referenced this pull request Dec 11, 2025
* Fix timeout configuration and switch to TLS.

* Switch VCR recordings from http to https.
sureshc added a commit that referenced this pull request Dec 11, 2025
…) (#69995)

* Fix timeout configuration and switch to TLS.

* Switch VCR recordings from http to https.
stephenliang pushed a commit that referenced this pull request Dec 11, 2025
* Fix timeout configuration and switch to TLS.

* Switch VCR recordings from http to https.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant