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

Warning logic issue #2342

Open
MelissaPage480 opened this issue Sep 10, 2020 · 6 comments
Open

Warning logic issue #2342

MelissaPage480 opened this issue Sep 10, 2020 · 6 comments

Comments

@MelissaPage480
Copy link

MelissaPage480 commented Sep 10, 2020

Current version:
Upgraded from:
Issue on tablet and/or server: Tablet only

Expected behavior

After correcting the cause of a warning and selecting Next once, the user should be able to proceed.

Actual behavior

After correcting the cause of a warning the warning still shows after selecting Next. The user needs to click next a second time to proceed

Steps to reproduce the behavior

Enter a value into a question that should throw a warning error then click next. Once the error throws, then change that value to something in the correct range and click next once.

@esurface
Copy link
Contributor

I took a look at this issue but am only able to reproduce it intermittently on the tablet, which disconnected from the dev tools over USB. I suggest we watch this issue and close it if it seems to only be applicable in this one case.

@rjcorwin
Copy link
Contributor

If this is an intermittent issue, it could be due to a race condition, which would explain why it's happening on tablets because tablets are much more prone to intermittent race conditions due to having less powerful processors that fluctuate in their ability to prioritize instructions from the open app.

Race conditions in JS are often caused by code that have entered "async" mode. Any time you see an HTTP request, a setTimeout(), a separate execution stack is created that can compete with the stack it came from. We've intentionally kept Tangy Form in synchronous mode, with rare exceptions such as GPS input. I wonder if something like a setTimeout() slipped in there somewhere causing this race condition...

@rjcorwin
Copy link
Contributor

Thank you @esurface and @MelissaPage480 for your help researching this so far! My suspicion is that the added complexity in tangy-form-item.js we had to add to validation in order to support warnings is getting tripped up.

@esurface
Copy link
Contributor

Digging deeper I found that I can reproduce the issue on the tablet while hooked up to the debugger. There is some combination of validation code, the 'value-change' -> 'change' events cascade that occurs when the text changes, and the re-applying of the 'show-if' statement that causes the 'Next' button to not fire the validation() function.

@esurface esurface pinned this issue Sep 15, 2020
@esurface esurface unpinned this issue Sep 15, 2020
esurface pushed a commit to Tangerine-Community/tangy-form that referenced this issue Sep 16, 2020
@esurface
Copy link
Contributor

This is a known issue with paper-button dating back to 2015. According to @rjsteinert they have since moved on to work on another library. For now users can workaround the issue by clicking a second time on the button.

@esurface esurface reopened this Sep 17, 2020
@esurface
Copy link
Contributor

Keeping open to track for release issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants