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

[QA] Call to a member function getCodeSuivi() on null / fix duplicate email notif #2304

Merged

Conversation

numew
Copy link
Collaborator

@numew numew commented Feb 29, 2024

Ticket

#1324

Description

  • Le code suivi d'un signalement ne doit plus changer
  • En cas d'accès a une URL incorrecte de suivi d'un signalement, redirection vers la homepage et modification du message d'erreur
  • A la validation/refus d'un signalement la notification de suivi automatique qui faisait doublon n'est plus transmise

Tests

  • Soumettre un signalement, l'accepter et le clôturer
  • Vérifier que le code de suivi n'a pas changé (le lien dans l'email de confirmation initial doit toujours fonctionner)
  • Vérifier qu'une seule notification à été envoyer par usager lors de l'acceptation et cloture.

Copy link
Collaborator

@hmeneuvrier hmeneuvrier left a comment

Choose a reason for hiding this comment

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

Tests et relecture OK

@@ -38,7 +38,9 @@ public function validationResponseSignalement(
$statut = Signalement::STATUS_ACTIVE;
$description = 'validé';
$signalement->setValidatedAt(new DateTimeImmutable());
$signalement->setCodeSuivi(md5(uniqid()));
if (!$signalement->getCodeSuivi()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Si on ne le change plus, ça vaut peut-être le coup de le complexifier un peu, non ? sur le nombre de signalement :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

y'a d'autres endroits où le setCodeSuivi est fait dans tous les cas ; est-ce qu'on peut mettre la condition dans la fonction setCodeSuivi, directement ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Le seul endroit ou la vérification n'est pas faite c'est à la création du signalement (nouveau et ancien formulaire mais l'ancien va sauter sous peu) l'idée est bonne mais ca veux dire qu'on pérennise l'idée que cela ne devra jamais changer au cours de la vie d'un signalement ? dans ce cas j'irais même plus loin et je mettrais la génération du code suivi dans le constructeur (comme pour l'uuid)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

oui dans le constructeur

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok c'est fait dans le constructeur via uuid

Copy link
Collaborator

@emilschn emilschn left a comment

Choose a reason for hiding this comment

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

Quelques retours. Pas encore testé.

src/Controller/FrontSignalementController.php Outdated Show resolved Hide resolved
src/Controller/FrontSignalementController.php Outdated Show resolved Hide resolved
@@ -470,7 +469,7 @@ public function suiviProcedure(

return $this->redirectToRoute('front_suivi_signalement');
}
$this->addFlash('error', 'Le lien utilisé est expiré ou invalide, verifier votre saisie.');
$this->addFlash('error', 'Le lien utilisé est invalide, vérifier votre saisie.');
Copy link
Collaborator

Choose a reason for hiding this comment

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

j'avais proposé vérifiez (ez à la fin)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oups, j'ai cru que tu relevais uniquement l'absence d'accent, c'est corrigé.

@@ -1293,7 +1294,7 @@ public function getCodeSuivi(): ?string
return $this->codeSuivi;
}

public function setCodeSuivi(?string $codeSuivi): self
public function setCodeSuivi(string $codeSuivi): self
Copy link
Collaborator

@emilschn emilschn Mar 4, 2024

Choose a reason for hiding this comment

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

ça risque pas de poser souci pour les existants qui sont déjà NULL ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bien vu merci, j'ai ajouté une migration

Copy link
Collaborator

@emilschn emilschn left a comment

Choose a reason for hiding this comment

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

Retours typo et une question :)

Copy link

sonarcloud bot commented Mar 5, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@emilschn emilschn left a comment

Choose a reason for hiding this comment

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

OK lecture et test !

@emilschn emilschn merged commit abf599e into develop Mar 5, 2024
3 checks passed
@sfinx13 sfinx13 deleted the bugfix/1324-call-to-a-member-function-getcodesuivi-on-null branch March 11, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants