ArgumentError (Attributes per element limit exceeded) when trying to open the diff of a locked topic

ArgumentError (Attributes per element limit exceeded) - when clicking on the “edit” icon to see topic version diffs.

Developer Console


Message (2 copies reported)

ArgumentError (Attributes per element limit exceeded)
lib/discourse_diff.rb:171:in `tokenize_html_blocks'
lib/discourse_diff.rb:10:in `initialize'
app/serializers/post_revision_serializer.rb:117:in `new'
app/serializers/post_revision_serializer.rb:117:in `body_changes'
(eval):18:in `_fast_attributes'
app/controllers/application_controller.rb:520:in `render_json_dump'
app/controllers/posts_controller.rb:408:in `latest_revision'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:356:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:187:in `call'


nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:38:in `fragment'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:38:in `initialize'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:52:in `new'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:52:in `parse'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5.rb:242:in `fragment'
lib/discourse_diff.rb:171:in `tokenize_html_blocks'
lib/discourse_diff.rb:10:in `initialize'
app/serializers/post_revision_serializer.rb:117:in `new'
app/serializers/post_revision_serializer.rb:117:in `body_changes'
(eval):18:in `_fast_attributes'



Is this on the site we host for you? We need to see the diff that causes the pathological behavior.

It’s self-hosted. What would be the best way to share the diff with you?

If there is nothing secret, can you try reproducing here? Just post a reply, then wait 10 minutes and make the problem edit.

It’s not a public community, and the material is regarding a beta product that’s not public either. So with all the respect to both the author of the material and the Discourse team, I’d prefer not to share it here. Any other simple way?

1 Like

I guess divide and conquer? Try making smaller and smaller repros until you find the culprit line?

1 Like

Shell I post the content of that particular topic in a PM to you here in Meta?

Feel free, especially if you can create a repro.