Skip to content

The bot's sign-in page sends a «Сетевой город» family to Петербург's diary when their diary answers something unreadable #158

Closed

Description

@lumenpearson

What is broken. When the upstream answers something the server cannot read (UnexpectedResponse, or SessionExpired at sign-in), /diary/signin/{ticket} shows a fallback that names one address to open in a browser. It is always dnevnik2.petersburgedu.ru. _why in server/app/api/diary_web.py is never told which diary the class is bound to, although the same page already resolves the binding to draw its subtitle (_binding_of, _where).

The failure scenario.

  1. An admin binds a class to «Сетевой город», e.g. region samara (asurso.ru), in «⚙️ Класс».
  2. A parent presses «🔐 Войти» and submits the form.
  3. The regional server answers a 200 of HTML: maintenance, a captcha, or a WAF page that does not match the refusal markers. NetSchoolClient raises UnexpectedResponse.
  4. The page says «…откройте dnevnik2.petersburgedu.ru в браузере, а потом попросите у бота новую ссылку». The parent opens Петербург's diary, which has nothing to do with their school and cannot tell them whether asurso.ru is down. The ticket is already spent, as designed.

Where. server/app/api/diary_web.py, _why's last branch (the fixed string naming dnevnik2.petersburgedu.ru), and its one caller in the POST handler, which has the class's binding in hand and does not pass it.

Found while correcting the page's password-path wording for #150.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions