Skip to content

Error When Start Session #139

@elsayedmohamed2020

Description

@elsayedmohamed2020

Sometimes face the error when start new session

0:30:54.602 [Client/Recv DEBUG]
10:31:03.113 [Client/QRChannel DEBUG] Emitting QR code 2@RECa7UgI5awj39BD5HuBYggSdtxs/vvEVSgZKef2qRon+6I53e4LdxriBQh3H1jI5BGrkGyr3ugH1mVJLBpgCbEK/55aBDrDavA=,2fTdkUKnt6fRPTsYwxgYCAPkeQT1/BVqzAXw9pTahjE=,H5squINw/cM5rtW21h+eM1qySGBeVPzPG/8AC+hLHHE=,67lEkrM/8fZ7xCfmZr41gwuU4qtNRDZG3XRvvpcFBKY=
Exception ignored on calling ctypes callback function: <bound method NewClient.__onQr of <client_worker.MyClient object at 0x11f3a22d0>>
Traceback (most recent call last):
File "/Users/elsayediraky/PycharmProjects/FastApi/myenv/lib/python3.12/site-packages/neonize/client.py", line 2683, in connect
self.__client.Neonize(
TypeError: NewClient.__onQr() takes 2 positional arguments but 3 were given

@client.event(QREv)
def handle_qr_code(_: NewClient, ev: QREv):
    """
    Handle QR code event when a new session is initialized.
    Stores the QR code in memory to be shown to the user for authentication.
    """
    print("QR code generated:", ev.Codes)  # Print QR code data
    # Inspect event for additional metadata
    print("Event attributes:", dir(ev))
    # Check if JID or session info is available (unlikely)
    jid = getattr(ev, 'jid', None)  # Check for JID (may not exist)
    print("✅✅✅✅CONNECTED JID", jid)
    qr = str(ev.Codes)
    qr_codes[user_id] = qr
    print(f"QR Code for {user_id}: {qr}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions