Conversation
…ate magic strings
…s to eliminate hardcoded type string checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descripción de los cambios
Este PR corrige y robustece la lógica de la función
agregarenhandlers/groups.pycuando un grupo de Telegram que ya existe en la base de datos se intenta re-agregar o reactivar (corriendo el comando/agregar...):elsedonde no se limpiaba el campowarned_atni se actualizabalast_activity. Esto causaba que, a pesar de que los usuarios corrieran el comando/agregaroptativapara mantenerlo activo (como les advertía el bot), el grupo se terminara archivando de todas formas después de 24 horas. Ahora, se limpia la advertencia, se actualiza la actividad al momento actual, y se les notifica que el aviso fue cancelado con éxito.validated = False): Si un grupo perdía validez debido a que su enlace de invitación moría (por ejemplo, bot expulsado temporalmente), su estado quedaba envalidated = False. Al correr/agregar...nuevamente, el bot actualizaba el link en base de datos pero lo dejaba convalidated = Falsede forma permanente y sin re-enviar la solicitud a Rozen. Ahora, cuando se re-agrega, se vuelve a mandar una solicitud interactiva a Rozen para su aprobación rápida.GrupoArchivado): Mantiene el comportamiento existente de reactivación directa.Tests Unitarios Añadidos
Se agregaron nuevos tests robustos en
test_archiving.py:test_agregar_warned_group_reactivates_successfully: Verifica que correr/agregar...sobre un grupo que tiene una advertencia activa de archivado limpiewarned_at, actualicelast_activityy responda con éxito.test_agregar_unvalidated_group_resends_to_rozen: Verifica que correr/agregar...sobre un grupo de-validado re-envíe exitosamente la notificación con botones interactivos a Rozen.Todos los tests unitarios pasaron exitosamente.