fix: stop masking workflow list errors as pre-v1.17#1682
Open
MyMirelHub wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR corrects the workflow dclient’s pre-v1.17 fallback behavior so that only codes.Unimplemented triggers the state-store fallback, while all other gRPC failures (notably codes.Unknown) are surfaced to the user with their real underlying error details.
Changes:
- Restrict the pre-v1.17 state-store fallback in
InstanceIDsandInstanceHistorytocodes.Unimplementedonly. - Add unit tests validating that
InstanceIDssurfaces runtime handler failures and still falls back onUnimplemented. - Add clarifying inline comments around the fallback decision logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/workflow/dclient/dclient.go | Tightens fallback gating to codes.Unimplemented for instance listing/history calls. |
| pkg/workflow/dclient/dclient_test.go | Adds coverage for InstanceIDs error/fallback behavior using a fake gRPC sidecar server. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pkg/workflow/dclient/dclient.go:231
preV117ProxyErrPrefixis documented as a stable prefix, but the check usesstrings.Contains, which is looser than intended and could misclassify unrelatedcodes.Unknownerrors that happen to include that substring. Usingstrings.HasPrefixboth matches the constant name/comment and reduces the risk of re-masking genuine runtime errors.
switch code.Code() {
case codes.Unimplemented:
return true
case codes.Unknown:
return strings.Contains(code.Message(), preV117ProxyErrPrefix)
default:
MyMirelHub
force-pushed
the
fix/cli-fallback-errors
branch
from
July 23, 2026 10:37
e995870 to
5398348
Compare
The pre-v1.17 state-store fallback in InstanceIDs triggered on codes.Unknown as well as codes.Unimplemented. Unknown is gRPC's catch-all for server-side errors, so every runtime failure of ListInstanceIDs was misreported as 'connection string is required for all database drivers for Dapr pre v1.17' and the underlying error was discarded. Classifying the error reliably is fragile (a real pre-1.17 daprd returns a version-dependent proxy error rather than Unimplemented), so instead of classifying: print the RPC error as a warning, attempt the state-store fallback, and if that also fails report both errors. Signed-off-by: MyMirelHub <15373565+MyMirelHub@users.noreply.github.com>
MyMirelHub
force-pushed
the
fix/cli-fallback-errors
branch
from
July 23, 2026 10:47
5398348 to
8fd4fe0
Compare
MyMirelHub
marked this pull request as ready for review
July 23, 2026 11:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
dapr workflow listtreated anycodes.Unknownerror from the sidecar as "runtime is pre v1.17" and fell back to the direct state-store path, printing:Unknownis gRPC's catch-all for server-side errors, so every runtime failure was misreported as a version problem and the real error was discarded.Classifying the error reliably is fragile — a pre-1.17 daprd returns a version-dependent proxy error rather than
Unimplemented. Instead, on any listing failure the CLI now prints the RPC error as a warning, attempts the state-store fallback, and reports both errors if the fallback also fails.Issue reference
Fixes #1681
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: