discourse icon indicating copy to clipboard operation
discourse copied to clipboard

FIX: poll ranked choice results not showing on first vote

Open merefield opened this issue 1 year ago • 4 comments

Currently (for Ranked Choice only) a javascript exception is raised on very first vote, preventing the results from being rendered requiring a browser refresh (which doesn't error).

Missing vote:

image

Resolves: TypeError: this.args.rankedChoiceOutcome.round_activity is undefined with simple addition of optional chaining operator.

merefield avatar Aug 26 '24 07:08 merefield

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/poll-ranked-choice-first-vote-causes-exception-and-fails-to-display-on-outcome/324448/2

discoursebot avatar Sep 02 '24 07:09 discoursebot

Ideally we would need a spec for this, do you know how to write system specs @merefield ?

jjaffeux avatar Sep 02 '24 11:09 jjaffeux

@jjaffeux sure, I'm probably responsible for at least a third of the front end tests on Poll by now! 😅

No problem, coming up!

merefield avatar Sep 02 '24 11:09 merefield

@jjaffeux done. This new test will fail without the fix and throw a global exception. If you prefer a different approach I'd be grateful if you could provide an example.

global failure: TypeError: Cannot read properties of undefined (reading 'length')

merefield avatar Sep 02 '24 12:09 merefield