I develop a community app that at some point needs to send json data and returns another json (the algorithm for tennis match scheduling).
The right way would be to use POST request but I am not in the situation to pay for call API which comes in the expensive tier.
I developed a code column hosted on github that does the work. But user experience is bad. Typically when app user provides some input in my app, I have a button to start executing the algorithm that typically lasts few minutes. During that time, I want to show some waiting cursor. My condition for waiting cursor is codecolumn to be empty (until I receive algorithm result). But this doesn’t work as the previous codecolumn execution value is still there and waiting cursor never gets displayed.
After a minute or two, Glide updates codecolumn with new values (which is OK), but app user is confused as there are no waiting indication.
The same happens with javascript post fetch column (additionally I have CORS issue there).
Any suggestions how to pack this so user have a nice experience (waiting the algorithm to complete the work)?
When you click on your button, first have it write the current code column value to another column, then execute your script. As long as both columns match, you could show your users something indicating that your code is processing. Once it returns something, then both columns will no longer match, meaning the code has completed.
I did exactly that, now reading your suggestion and it works in 99% of the cases. Thanks for suggestion.
I noticed when users doing input in the screen so the resulting json that I am sending is different works for some input and for other doesn’t work. For some input Glide doesn’t trigger code column to evaluate a new value.
If the component that affects json is on the same screen where the underlying table is - then it does trigger, otherwise if in another table it doesn’t
I added the waiting cursor (gif) tho indicate the progress while my new code column != old code column value.
For some reason it shows up only sometimes - although the computation is in process. I believe the reason is the other thread (that does code column computation) never allows UI thread to refresh the screen.
You could try adding two steps to your action, show new screen (with the gif) and goto tab (to end it)
Modify your action sequence so the first action is show new screen (overlay) and put your gif on the screen. Then make the last action goto tab (to end)
before my algorithm starts oldCodeColumn != newCodeColumn
when I click on StartAlgorithm, I assign oldCodeColumn = newCodeColumn
Call the algorithm, ShowWaitingCursorGif while oldCodeColumn == newCodeColumn
When newCodeColumn is evaluated, the process is done and giff is not displayed anymore.