v1.7.1: fix all P1-P4, C1-C6, H1-H6, M1-M7, L1-L3 from error.md — async migrations, CSS variables, SQL validation, event loop, prompt injection, VCF parsing, race conditions, unused imports, gitignore

This commit is contained in:
2026-05-29 03:46:41 +03:00
parent 72b6879f4b
commit 54af5892d5
21 changed files with 406 additions and 156 deletions
+1 -11
View File
@@ -20,7 +20,7 @@ async def handle_contact_received(user_id: int, conv_id: int, contact_text: str)
if PHONE_PATTERN.match(contact_text):
user.phone = contact_text
elif EMAIL_PATTERN.match(contact_text):
user.phone = contact_text
user.email = contact_text
result = await db.execute(
select(BotConversation).where(BotConversation.id == conv_id)
@@ -39,16 +39,6 @@ async def handle_contact_received(user_id: int, conv_id: int, contact_text: str)
async def handle_manual_contact(user_id: int, conv_id: int, text: str) -> None:
text = text.strip()
async with async_session() as db:
msg = BotMessage(
conversation_id=conv_id,
direction="incoming",
text=text,
created_at=datetime.datetime.utcnow(),
)
db.add(msg)
await db.commit()
if PHONE_PATTERN.match(text) or EMAIL_PATTERN.match(text):
await handle_contact_received(user_id, conv_id, text)
else: