Skip to content

fix: use 5-min default timeout for PowerQuery refresh when not specified#493

Merged
sbroenne merged 1 commit intomainfrom
fix/powerquery-refresh-default-timeout
Feb 22, 2026
Merged

fix: use 5-min default timeout for PowerQuery refresh when not specified#493
sbroenne merged 1 commit intomainfrom
fix/powerquery-refresh-default-timeout

Conversation

@sbroenne
Copy link
Owner

Bug Fix: PowerQuery Refresh Default Timeout

Fixes #492

Problem

excelcli powerquery refresh throws ArgumentOutOfRangeException when --timeout is omitted, making the command unusable without explicitly specifying a timeout.

Root Cause

The ServiceRegistryGenerator creates nullable TimeSpan? in generated args classes. The dispatch code uses args.Timeout ?? default(System.TimeSpan) which evaluates to TimeSpan.Zero when timeout is not provided. The Core PowerQueryCommands.Refresh() method validated timeout <= TimeSpan.Zero and threw.

Solution

Changed Core validation from throwing to using a 5-minute default timeout when timeout <= TimeSpan.Zero. This is minimal, backwards-compatible, and matches the documented auto-timeout behavior.

Files Changed:

  • PowerQueryCommands.Refresh.cs - Use default timeout instead of throwing
  • IPowerQueryCommands.cs - Updated interface descriptions (2 places)
  • PowerQueryCommandsTests.RefreshErrors.cs - Added 2 regression tests

Test Coverage (22 tests, all passing)

  • Refresh_ZeroTimeout_UsesDefaultAndSucceeds - Regression test for the exact generated dispatch bug
  • Refresh_NegativeTimeout_UsesDefaultAndSucceeds - Edge case validation
  • All 20 existing refresh tests continue to pass

Backwards Compatibility

Fully backwards compatible - callers providing explicit positive timeouts are unaffected.

…ied (#492)

Root cause: Generated dispatch uses args.Timeout ?? default(TimeSpan) = TimeSpan.Zero
when timeout is omitted. Core validation threw ArgumentOutOfRangeException.

Fix: Changed Core validation to use 5-minute default timeout instead of throwing.
Updated interface descriptions to document the new behavior.

Tests: Added 2 regression tests (ZeroTimeout, NegativeTimeout) - total 22 refresh tests pass.
@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sbroenne sbroenne merged commit 5428654 into main Feb 22, 2026
4 checks passed
@sbroenne sbroenne deleted the fix/powerquery-refresh-default-timeout branch February 22, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PowerQuery refresh throws ArgumentOutOfRangeException when timeout not specified

1 participant