Error when creating a new Badge

AI-generated summary

A bug was reported by Richie in Discourse v2.4.0.beta1 where creating a new Badge causes a persistent ‘Saving…’ message and a console error related to ace.js, though the badge is still created successfully. The issue was reproducible on Safari 12.1.1 and Firefox 65.0.1. 2 sam confirmed the bug and assigned it to techAPJ, who identified that the Save process fails if no badge query is present. The fix was implemented in commit ccb3ba5 and backported to both beta and stable branches. Richie thanked techAPJ for the quick resolution.

I have an issue when creating a new Badge on my Discourse v2.4.0.beta1 +7

I did compare to latest: https://github.com/discourse/discourse/compare/34f382b…dc5eb76 but saw no mention of a Badge fix, hence this bug report.

Steps to reproduce:

  1. Fill in the relevant parts of the form and click Save button

  2. The message ‘Saving…’ appears, and does not then disappear:

  1. A console error is caught re ace.js

  1. Clicking away from the page throws a browser message asking if I’m sure I want to leave that page

  2. The badge does get created successfully :+1:t2:

Able to reproduce on both Safari 12.1.1 and Firefox 65.0.1

4 Likes

Confirmed! Thanks heaps for the report. @techAPJ can you investigate and fix.

If this impacts “stable” we should back port the fix.

6 Likes

Taking a quick look at this, the create (Save) process fails if there is no badge query present. Fixed via:

https://github.com/discourse/discourse/commit/ccb3ba509defff2d74944c92195da7362c4979b1

Backported to beta and stable.

8 Likes

Thanks for the quick fix @techAPJ :+1:t2:

4 Likes