Skip to content

fix(csv-export): always finalize progress on no-op export (PR #167 follow-up) #191

@cptkoolbeenz

Description

@cptkoolbeenz

Surfaced from a Qodo /improve on the Python port of PR #167 (daqifi/daqifi-python-core PR #103, importance 6).

Bug

`CsvExporter.ExportAsync` early-returns when the source has no channels but doesn't call `progress.Report(100)`:

```csharp
var channels = source.GetChannels();
if (channels.Count == 0)
return; // <-- caller's progress bar stalls below 100%
```

Both successful export paths (`ExportAllSamplesAsync` and `ExportAveragedAsync`) call `progress?.Report(100)` before returning. The no-channels early-return is the one place that doesn't, so a caller wiring the progress callback to a UI element gets a bar stuck below 100% on no-op exports.

Fix (already shipped in Python port)

```csharp
var channels = source.GetChannels();
if (channels.Count == 0)
{
progress?.Report(100);
return;
}
```

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions