Never seeing the first progress message from `cli_progress_along()`

Open
#668 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
cli

Research direction

Start by reproducing the issue with cli_progress_along(1:2) and the format shown in the report, then trace the cli_progress_along() entry point and its progress-update timing. Confirm the behavior across both iterations. Done means the first progress message appears for the first iteration and subsequent messages correspond to the current iteration.

Written by the indexing model from the issue text.

Description

bug tidy-dev-day :nerd_face:

cli_progress_along() seems to be skipping the first iteration, and after 2 seconds, the function outputs the message regarding the first iteration even though it is on the second?
 

library(cli)
lapply(cli_progress_along(1:2, 
                        format = "Downloading data file {cli::pb_current}"),
     function(i) {
Sys.sleep(2)
})
#> Downloading data file 1
#> [[1]]
#> NULL
#> 
#> [[2]]
#> NULL

Created on 2024-02-02 with reprex v2.0.2

Dominant language
R
Stars
726
Forks
94
Avg merge
3h 35m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/cli

All issues in r-lib/cli

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.