Skip to content

Alert from frontend errors in critical paths#10937

Merged
alecslupu merged 10 commits intodevelopfrom
fix/elections-alert-from-frontend-errors-in-critical-paths
Jul 28, 2023
Merged

Alert from frontend errors in critical paths#10937
alecslupu merged 10 commits intodevelopfrom
fix/elections-alert-from-frontend-errors-in-critical-paths

Conversation

@andreslucena
Copy link
Copy Markdown
Member

@andreslucena andreslucena commented May 31, 2023

🎩 What? Why?

During the voting process in Elections, there could be some exceptions, and these will not be shown to the participant. They are only visible in the console.

📌 Related Issues

Testing

  1. Having a working Election. Things like Change the Elections' setup minimum hours before start setting to 1 hour #10900 and Document how to work locally with Elections/Votings #10870 should ease up the process
  2. Generate an exception on the try block. I've done with
diff --git a/decidim-elections/app/packs/src/decidim/elections/voter/new-vote.js b/decidim-elections/app/packs/src/decidim/elections/voter/new-vote.js
index ca0ad26d60..2411519c89 100644
--- a/decidim-elections/app/packs/src/decidim/elections/voter/new-vote.js
+++ b/decidim-elections/app/packs/src/decidim/elections/voter/new-vote.js
@@ -21,6 +21,7 @@ $(async () => {
   // Get the vote component and bind it to all UI events
   const voteComponent = setupVoteComponent($voteWrapper);
   try {
+    throw new Error("Testing");
     await voteComponent.bindEvents({
       onBindEncryptButton(onEventTriggered) {
         $(".button.confirm").on("click", onEventTriggered);
  1. See the error

📷 Screenshots

Screenshot of the new "Failed" screen

♥️ Thank you!

@andreslucena andreslucena added module: elections type: fix PRs that implement a fix for a bug labels May 31, 2023
@andreslucena andreslucena marked this pull request as draft May 31, 2023 15:41
@andreslucena andreslucena marked this pull request as ready for review June 1, 2023 17:06
@andreslucena andreslucena requested a review from a team June 1, 2023 17:06
alecslupu
alecslupu previously approved these changes Jul 13, 2023
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there is an error triggered by the js present in new-vote.js, the screen displayed the erros message.
I could not test using the real vote algorithm due to some access code issues. I could reproduce the behaviour in the preview mode.

@alecslupu
Copy link
Copy Markdown
Contributor

@andreslucena This is approved, but i will leave it as it is for the moment. Your call when to merge it.

@andreslucena
Copy link
Copy Markdown
Member Author

@alecslupu let's leave this without merging until the redesign of elections (#10804) is merged in develop

@alecslupu
Copy link
Copy Markdown
Contributor

@andreslucena #10804 has been merged, and now we have 3 conflicts on this PR.

@andreslucena andreslucena added the no-backport Pull Requests that should not be backported label Jul 24, 2023
@andreslucena
Copy link
Copy Markdown
Member Author

#10804 has been merged, and now we have 3 conflicts on this PR.

@alecslupu I've merged with develop and solved the issues. I had to make a small change regarding the show/hide new API (see 3b393e0).

I've updated it the Screenshot with the new error message. You can trust me on this one if you don't want to check it out again 😄 (as it's a pain to work with the bulletin-board, i.e. having to wait 1/2 hours just to try this small change).

I've also added the no-backport label as decidim-elections isn't officially released and it's just too much effort to invest in something that no-one is using yet in production. We can apply this same principle to other PRs from decidim-elections too of course.

Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Since (3b393e0) is the only change to what i have previously approved, i am approving it in the current state :) .

@alecslupu alecslupu merged commit 894d19e into develop Jul 28, 2023
@alecslupu alecslupu deleted the fix/elections-alert-from-frontend-errors-in-critical-paths branch July 28, 2023 06:38
entantoencuanto added a commit that referenced this pull request Jul 28, 2023
* develop:
  Reorder and renumber the RELEASES_NOTES (#11379)
  Add videos services to CSP (youtube-nocookie.com, meet.jit.si, etc) (#11155)
  Alert from frontend errors in critical paths (#10937)
  Redesign: comments issues (#11363)
  Redesign: participatory process steps (#11226)
  Redesign: meetings map (#11383)
  Redesign: rename layouts (#11126)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: elections no-backport Pull Requests that should not be backported type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants