readthedocs-fr / bin-server

Un outil pour héberger des snippets de code et les partager via une URL.
https://bin.readthedocs.fr
MIT License
14 stars 15 forks source link

fix: 404 not found when parent snippet is missing #111

Closed enimaloc closed 3 years ago

enimaloc commented 3 years ago

When the user duplicates an existing snippet, the server fetches the code of the parent snippet via redis. When the snippet was missing, the server was crashing due to a KeyError("Snippet not found"). This commit fixes the problem by returning a 404 Snippet not found HTTP error code and status to the client in such case.

The problem is unlikely to happen under "normal" conditions as the snippet must expires just between the moment the user fetches the snippet the first time and the moment he clicks on the "duplicate" button.

Julien00859 commented 3 years ago

Aussi coca, comme on vient de passer en v1.0, tu es le premier à devoir changer la version, on a pas encore de CI qui le fait automatiquement. Du coup est-ce que tu veux bien manuellement changer le fichier VERSION de 1.0.0 à 1.0.1 stp ?

Julien00859 commented 3 years ago

Pour moi c'est ok, sous réserve de rebaser la branche sur main et de squasher les commits.

What the fuck is he talking about ?!?!

"rebaser la branche sur main" => récupérer la dernières modifications mergées sur le branche main en local et fusionner ta branche et la branche main en utilisant la stratégie rebase.

"squasher les commits" => ici tu as 3 commits, pour que je merge il faut tous les fusionner en un seul, tu peux utiliser le rebase interactif pour ça (cf mon dernier message).

Là j'ai pas forcément beaucoup de temps à te consacrer (je suis au boulot) mais si tu galères n'hésite pas à demander aux autres sur discord :)