Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to validate template: content must be shorter than or equal to 5000 characters" despite template being under character limit #1835

Open
2 tasks done
nicokempe opened this issue Nov 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nicokempe
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Supabase returns an error "Failed to validate template: content must be shorter than or equal to 5000 characters," although the email template I am using does not exceed this limit. The template is about 3700 characters, and even when minified, it reaches only 2088 characters. This issue appears to be a false positive on the character limit validation.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Steps to reproduce the behavior:

  1. Create an email template with approximately 3700 characters.
  2. Minify the template to reduce character count.
  3. Attempt to save or use the template within Supabase.
  4. Observe the error stating the content exceeds 5000 characters.
  5. I have added one of my email templates to reproduce the issue

Expected behavior

The template should save successfully without triggering the character limit validation error, as it does not exceed the 5000-character limit. It worked already for the last months but it just stopped working, the last email I got has been received 2 days ago.

Screenshots

Network Traffic (comes from spam protection?)
image

Error notification when navigating to another email template:
image

System information

  • Website: Supabase Cloud
  • Plan: Free
  • Organization: "Dashio KG" (qyjgjvclovhpvynbofdd)
  • Browser: Tested on both, Microsoft Edge and Mozilla Firefox

Additional context

This issue occurs even after minifying the template. The problem suggests that the character count validation may not be accurately calculated on Supabase's end, potentially counting whitespace or other formatting redundantly. The error is new, as similar templates with similar character counts previously saved without issues.

One of my used email templates is attached. Thanks for your support!

minified-custom-email-template-magic-link.zip

@nicokempe nicokempe added the bug Something isn't working label Nov 11, 2024
@nicokempe
Copy link
Author

After further investigation, including both front-end and backend code analysis within the Supabase codebase, no configurations or validation constants defining a 5000-character limit have been identified. This suggests the character limit may be enforced at a deeper level within Supabase's backend infrastructure or as a recent change not reflected in the public codebase.

Thank you for your assistance, and please let me know if further testing or details would be useful!

@phamhieu
Copy link
Member

Hi @nicokempe, thanks for the report! We'll be increasing the max content length for the template validation api. This limit is in place to protect our api service.
Rest assured, there's no limit on the template length, so this error won't prevent you from saving the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants