meglio reported an ArgumentError (Attributes per element limit exceeded) error occurring when attempting to view the diff of a locked topic on their self-hosted Discourse instance. The error originates in lib/discourse_diff.rb during the tokenization of HTML blocks, specifically triggered by the PostRevisionSerializer. sam requested a reproduction of the issue, but meglio declined to share the content publicly due to confidentiality regarding a beta product. They agreed to share the content via private message if a reproducible example could be isolated.
Meanwhile, copymonopoly contributed a related report, noting that they experience backend timeouts (502/504) when saving major edits to extremely long posts (around 100,000 characters). They suspect the root cause is the computational expense of calculating diffs between large revisions. Consequently, zogstrip closed this thread, directing the discussion to a separate topic focused on backend timeouts caused by diff bottlenecks in long posts.
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?
I’m also experiencing a very similar (or related) issue.
Reproduction steps / cause:
The problem occurs on extremely long posts (around 100,000 characters).
It is triggered specifically by large-scale revisions (when a huge portion of the content is changed).
When trying to save such a massive edit, the backend often hits a timeout (502/504). I suspect the root cause is the Diff calculation between the old and new versions, which becomes extremely expensive under these two conditions combined.