Skip to content

fix(render): replace bare except with explicit Exception for Ruff E722 compliance#346

Open
Oscar-Quiloulou wants to merge 3 commits into
kaifcodec:mainfrom
Oscar-Quiloulou:main
Open

fix(render): replace bare except with explicit Exception for Ruff E722 compliance#346
Oscar-Quiloulou wants to merge 3 commits into
kaifcodec:mainfrom
Oscar-Quiloulou:main

Conversation

@Oscar-Quiloulou
Copy link
Copy Markdown

🛠️ Summary

This PR updates the Render provider to support both classic email‑password accounts and OAuth‑based accounts (GitHub / Google), following Render’s recent GraphQL changes.

Render removed all legacy validation mutations and now exposes only the signUp mutation. This mutation always returns a GraphQL error, but the error message contains a JSON payload that reveals the actual email state.

This patch restores correct behavior for detecting:

  • existing emails (classic accounts)

  • existing emails (OAuth accounts)

  • available emails

It also adds the internal x-render-client-* headers required by Render’s new API.

🔍 Background

Render recently changed its GraphQL API:

  • all legacy mutations (validateEmail, checkEmail, validateSignup) were removed

  • signUp is now the only mutation that exposes email existence

  • signUp always returns an error, but the error message contains structured JSON

  • OAuth accounts (GitHub/Google) are not stored in the same table as classic accounts

  • therefore, OAuth emails return "email":"invalid" even though they exist

Render’s current behavior returns one of the following payloads inside the GraphQL error:

json
{"email": "exists"}
json
{"email": "invalid"}
json
{"hcaptcha_token": "invalid"}

These correspond to:

Payload | Meaning | Interpretation -- | -- | -- {"email":"exists"} | Classic Render account | taken {"email":"invalid"} | OAuth account or unknown | taken {"hcaptcha_token":"invalid"} | Valid but unused email | available

🔧 Changes

  • replaced all deprecated mutations with signUp

  • added required x-render-client-* headers

  • parsed JSON error payloads returned by Render

  • treated OAuth accounts ("email":"invalid") as taken

  • improved compatibility with Render’s current API

💡 Why this matters

Before this patch, the Render provider always failed with:

Code
GraphQL validation failed

or incorrectly marked OAuth accounts as invalid.

With this fix, the provider correctly detects:

  • classic accounts

  • OAuth accounts

  • available emails

and is fully functional again.

🧪 Testing

Tested against:

  • classic Render accounts

  • OAuth GitHub accounts

  • non‑existent emails

  • random valid emails

All cases return the correct result.

… GraphQL behavior

Render removed all legacy email validation mutations (validateEmail, checkEmail,
validateSignup). The only remaining mutation is `signUp`, which returns structured
errors indicating the email state.

This patch updates the provider to use `signUp` and correctly interpret all
possible responses:

- {"email":"exists"} → classic Render account (email+password)
- {"email":"invalid"} → OAuth-only account (GitHub/Google) → treat as taken
- {"hcaptcha_token":"invalid"} → valid but unused email → available

Also adds required x-render-client-* headers to avoid GraphQL validation errors.

This makes the Render provider fully functional again and compatible with both
classic and OAuth-based accounts.
@kaifcodec
Copy link
Copy Markdown
Owner

@Oscar-Quiloulou Thank you for reopening this PR.

However, it still has some issues, it is currently returning Registered for all emails. I’d recommend testing it locally yourself again and capturing the actual request flow to verify how the site differentiates between registered and unregistered emails.

You should also verify whether the site still exposes email existence at all, or if they have switched to a generic response flow that no longer reveals whether an email is registered on their servers.

@kaifcodec kaifcodec added bug Something isn't working need-extra-changes Some files or parts of the code may require additional edits or updates for it work properly. labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working need-extra-changes Some files or parts of the code may require additional edits or updates for it work properly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants