Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected q.args for multi- or broadcast #1705

Closed
Far0n opened this issue Nov 17, 2022 · 8 comments · Fixed by #2123
Closed

Unexpected q.args for multi- or broadcast #1705

Far0n opened this issue Nov 17, 2022 · 8 comments · Fixed by #2123
Assignees
Labels
bug Bug in code server Related to server

Comments

@Far0n
Copy link

Far0n commented Nov 17, 2022

Wave SDK Version, OS

wave 0.23.1, ubuntu 18.04

Actual behavior

chrome_IUQ5YWB72Q.mp4

Presence of textbox in q.args is inconsistent across browser tabs. This also happens with mode "broadcast" and if q.app is used instead of q.user to manage the app-state.

Expected behavior

Presence of textbox in q.args is to be expected consistent across browser tabs.

Steps To Reproduce

Use the following app in 2 browser tabs as shown in the video above:

from h2o_wave import Q, app, main, ui  # noqa F401


@app("/", mode="multicast")
async def serve(q: Q):
    print(f"q.args: {q.args}")
    if not q.user.inited:
        q.page["meta"] = ui.meta_card(box="", title="WaveApp")
        q.user.inited = True
        q.user.form2 = False

    if q.args["click_me"]:
        q.user.form2 = not q.user.form2

    q.page["form1"] = ui.form_card(
        box="1 1 1 1", items=[ui.button(name="click_me", label="click me")]
    )

    if q.user.form2:
        q.page["form2"] = ui.form_card(
            box="1 2 3 2", items=[ui.text(f"q.args: {q.args}"), ui.textbox(name="textbox", value="some_value")]
        )
    else:
        del q.page["form2"]

    await q.page.save()
@Far0n Far0n added the bug Bug in code label Nov 17, 2022
@Far0n
Copy link
Author

Far0n commented Dec 5, 2022

Here it becomes easier to spot I think:

Code_lEqiqIrTU2.mp4

@mturoci mturoci added the server Related to server label Dec 6, 2022
@aruiz2
Copy link
Contributor

aruiz2 commented Dec 11, 2022

@Far0n what file are you running to see what you displayed in the video from 6 days ago with the dark screen? I was unable to reproduce the error you put in the first video, seems to work fine to me. So I was wondering how you got to run the second video so that I can take a look into this issue. Thanks!

@Far0n
Copy link
Author

Far0n commented Dec 11, 2022

the 2nd video ist from our Model Validation App

@Qingyang-Sophia
Copy link

@Far0n May I ask where can we find this Model Validation App? (I tried to search for it but could not find it) Thank you~

@Far0n
Copy link
Author

Far0n commented Dec 12, 2022

Please see slack channel h2o-model-validation for more information.

@mturoci
Copy link
Collaborator

mturoci commented Aug 30, 2023

Hey @Far0n is this still an issue on the latest 0.26? I cannot seem to repro:

Screen.Recording.2023-08-30.at.3.23.16.PM.mov

The UI is synced properly.

@Far0n
Copy link
Author

Far0n commented Aug 30, 2023

The UI is synced properly.

The "problem" is still there. It's not about the UI being synced, but different q.args depending on the browser tab we make the submit from. From your vid: the first few seconds are clicks in the left tab and the q.args are "click_me:True", but then around 6s you click the button in the right tab and now suddenly q.args became: "click_me:True, textbox: some_value" (the latter coming from q.page["form2"] which was deleted by the click in the left tab before).

@mturoci
Copy link
Collaborator

mturoci commented Aug 31, 2023

Makes sense, thanks for the further explanation. It is a bug indeed. Although fixing it is a breaking change, not many people use other mode than unicast and they have some hacks in place to workaround this behavior anyway. Moreover, as 1.0 is nearing, it seems like a good time to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code server Related to server
Projects
None yet
4 participants