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

[BUG] Onboarding UI Progress Bar not Progressing #114

Closed
cgolebio opened this issue Aug 24, 2022 · 2 comments · Fixed by #117 or #134
Closed

[BUG] Onboarding UI Progress Bar not Progressing #114

cgolebio opened this issue Aug 24, 2022 · 2 comments · Fixed by #117 or #134
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cgolebio
Copy link
Contributor

Describe the bug
I am having an issue with the onboarding workflow Common Progress Bar. It does not seem to be progressing.

To Reproduce
I modified the "Progress with Cancel Button" example because I was able to get this example to work. I simply changed the type attribute, removed the accessory payload attributes and added the payload for onboarding. Included here are the modified script and the onboarding-ex.json file.

Notifier script

#!/bin/bash

RAND_QUOTE=("Making Things Faster" "Adding Sparkles" "Reticulating Splines" "Thowing Wrenches" \
"rm -rf'ing Directories" "Lorem Ipsumming" "Agitating Employees" "Eating Doughnuts")
PIPE_NAME="pbnota"
COUNTER=0

# FIFO creation and setup process for updating the progress bar
find /private/tmp -name "$PIPE_NAME" -delete
mkfifo /private/tmp/${PIPE_NAME}
exec 3<> /private/tmp/${PIPE_NAME}

# IBM Notifier Progress Bar configuration
"/Applications/IBM Notifier.app/Contents/MacOS/IBM Notifier" \
-type "onboarding" \
-payload onboarding-ex.json \
-always_on_top < /private/tmp/${PIPE_NAME} &

PB_PS=$(pgrep "IBM Notifier")
echo "$PB_PS"

# In this example we are doing a 5 digit increment up to 100 and updating the progress bar messages with a
# random selection from our quote array defined above. In real world usage your update commands would run
# in the until block and update your progress percentage and description accordingly.
until [[ "$COUNTER" -ge 100 ]]; do
    if [[ $(pgrep -q "IBM Notifier"; echo $?) -ne 0 ]]; then
        # Cancel initiated, roll back changes and break the until loop here
        CANCEL=1
        echo "Rolling back"
        break
    fi
    COUNTER=$((COUNTER + 5))
    QUOTE_NBR=$(jot -r 1 0 7)
    echo -n "/percent $COUNTER /top_message ${RAND_QUOTE[$QUOTE_NBR]} /bottom_message ${COUNTER}% completed" >&3
    sleep 1
done

wait "$PB_PS"

# Clean up the progress bar after completion or early exit
exec 3>&-
find /private/tmp -name ${PIPE_NAME} -delete

if [[ "$CANCEL" -eq 1 ]]; then
    echo "Progress bar terminated early"
else
    echo "Progress bar completed successfully"
fi

Onboarding JSON

{
  "progressBarPayload": "/percent 0 /top_message Onboarding Progress /bottom_message Checking connection to management servers...",
  "pages": [
    {
      "title": "Welcome to your Mac",
      "subtitle": "Thanks for choosing a Mac!",
      "body": "We are setting things up.  Thanks for your patience."
    }
  ]
}

Expected behavior
I expect that when passed the progress payload via the subprocess, it should increment the Common Progress Bar.

Screenshots
The notifier will simply sit here, not progressing. The counter will count in the background.

image

Desktop (please complete the following information):

  • OS: macOS 11
  • Project version: 2.8.0 build 87 and recompiled main

Additional context
It would be good to update the example scripts perhaps with use of the common progress bar so that there is additional reference material other than what is in the onboarding UI section.

@cgolebio cgolebio added the bug Something isn't working label Aug 24, 2022
@cgolebio cgolebio changed the title [BUG] Onboarding UI Progress Bar not Progressing Aug 24, 2022
@cgolebio cgolebio changed the title Onboarding UI Progress Bar not Progressing [BUG] Onboarding UI Progress Bar not Progressing Aug 24, 2022
@SMartorelli
Copy link
Member

Hi @cgolebio thanks for reporting this bug. The new Onboarding is still in Beta so this might happen. We'll work on the resolution of this bug in the next iteration.

@cgolebio
Copy link
Contributor Author

Hi @SMartorelli , I took a stab at the fix in the related pull request. I have tested and this seems to work perfectly as I expect. Please feel free to test also and appreciate your review!

@SMartorelli SMartorelli mentioned this issue Oct 3, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants