Skip to content

ProgressJob column pruning in start!() causes spooky action at a distance #280

@impact-basin

Description

@impact-basin

The invocation of filter!() in start!() is mutating.

filter!(c -> c != ProgressColumn, job.columns)

If I call addjob!() or swapjob!() with a vector of column elements, this pruning will mutate the vector at the callsite. This is spooky action at a distance and can lead to unexpected behaviour.

It is best if the vector is copied at the point of ProgressJob creation: specifically, this line:

columns,

should become

copy(columns),

and the same should be done for other mutable items passed across the interface.

In my use, a config array used for two, cases where N = nothing and N isa Integer, was being erroneously mutated -- the progress bars in the image linked in #279 were being spuriously deleted.

The last commit in PR #279 fixes this issue, but it may be desirable to patch this while you review the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions