Skip to content

fix: wire --timeout through refresh-all and fix pipe request timeout#504

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

fix: wire --timeout through refresh-all and fix pipe request timeout#504
sbroenne merged 1 commit intomainfrom
fix/powerquery-refresh-all-timeout

Conversation

@sbroenne
Copy link
Owner

Problem

Two root causes combined to make powerquery refresh-all --timeout 1800 always cancel at exactly 5 minutes:

  1. Pipe layer: ServiceClient.DefaultRequestTimeout = 300s — the pipe cancelled at 5 min regardless of any --timeout value passed to the CLI.
  2. Missing parameter: RefreshAll() had no timeout parameter, so the --timeout CLI flag was silently ignored, and cancellationToken: default was passed to batch.Execute().

Fix

  • RefreshAll() now accepts TimeSpan timeout = default (default: 5 minutes), matching the existing Refresh() pattern. A CancellationTokenSource(timeout) is created and its token passed to batch.Execute().
  • ServiceClient.DefaultRequestTimeout increased to TimeSpan.FromHours(2), ensuring the pipe layer never races with the operation timeout.
  • Source generator (StringHelper.GetDefaultValueString): non-nullable value-type parameters with = default (e.g. TimeSpan timeout = default) now emit "default" instead of "null" in generated code. Nullable<T> structs (bool?, int?) keep "null".
  • SKILL.md: corrected doc — timeout=0 or omitted uses the 5-min default.

Testing

  • 102/103 PowerQuery tests pass. The 1 failure (Refresh_LoadedToDataModel_PreservesSettings) is a slow-environment flake: the Data Model refresh took 6m6s against the 5-min Refresh() timeout — unrelated to these RefreshAll changes.

Root causes:
1. ServiceClient.DefaultRequestTimeout was 300s, so the pipe layer always
   cancelled at 5 minutes regardless of --timeout on CLI or session open.
2. RefreshAll() had no timeout parameter, so --timeout on 'powerquery
   refresh-all' was silently ignored and cancellationToken: default meant
   the session operationTimeout had no effect either.

Fixes:
- RefreshAll() now accepts TimeSpan timeout (default 5 min) matching the
  Refresh() pattern: CancellationTokenSource(timeout) applied so the
  caller's --timeout is honoured end-to-end.
- ServiceClient.DefaultRequestTimeout increased to TimeSpan.FromHours(2)
  so the pipe layer never races with the operation timeout.
- StringHelper.GetDefaultValueString: non-nullable value-type params with
  '= default' (e.g. TimeSpan timeout = default) now emit 'default' instead
  of 'null' in generated Request DTOs. Nullable<T> structs keep 'null'.
- SKILL.md corrected: timeout=0 uses the 5-min default, not an error.
@github-actions
Copy link

Dependency Review

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

Scanned Files

None

@sbroenne sbroenne merged commit 737689b into main Feb 22, 2026
4 checks passed
@sbroenne sbroenne deleted the fix/powerquery-refresh-all-timeout branch February 22, 2026 19:01
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.

1 participant