Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring: améliore la gestion des erreurs des followups #4652

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Shamzic
Copy link
Contributor

@Shamzic Shamzic commented Oct 15, 2024

PR intermédiaire à #4648 / #4643

  • Ajoute un type enum pour les statuts et les messages d'erreur
  • Centralise la remontée des erreurs dans la persistance du followup
  • Modifications ouvertes à toute suggestion d'amélioration

@github-actions github-actions bot added this to the BC actuel milestone Oct 15, 2024
@Shamzic Shamzic removed the request for review from yasmine-glitch October 15, 2024 12:26
Copy link
Contributor

@jenovateurs jenovateurs left a comment

Choose a reason for hiding this comment

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

Quelques petites modifications, je pense que je vais devoir adapter l'autre PR sur le sujet ou l'annuler.

} else {
return createSimulationRecapUrl(req, res)
if (phone) await sendSimulationResultsSms(followup)
if (email) await sendSimulationResultsEmail(followup)
Copy link
Contributor

Choose a reason for hiding this comment

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

J'aurais inversé, d'abord l'e-mail et ensuite le téléphone car plus de chance que le premier fonctionne.
On pourra aussi adapter le message en mode erreur avec le numéro de téléphone, l'email a bien été envoyer ressayer plus tard ou un truc du genre.

Copy link
Contributor Author

@Shamzic Shamzic Oct 16, 2024

Choose a reason for hiding this comment

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

Peut-être dans un second temps, faire les deux envois séparément avec des messages dédiés à chaque service (ex: "l'email a bien été envoyé", puis "Le sms a bien été envoyé") ?

@@ -228,6 +223,6 @@ export async function logSurveyLinkClick(req: Request, res: Response) {
} catch (error) {
Sentry.captureException(error)
Copy link
Contributor

Choose a reason for hiding this comment

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

À postériori, je me demande si le captureException et le console error est pertinent, sachant qu'on ne retrouve plus le survey.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Le console.error c'est sûr qu'il n'est pas utile. Le captureException, comme tu avais pris l'initiative de l'ajouter, je te laisse décider si tu souhaites le retirer. Je l'aurais aussi enlevé de mon côté

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: En revue
Development

Successfully merging this pull request may close these issues.

2 participants