Repository navigation
Conversation
Watching a missing Task waits indefinitely after discarding its initial lookup error. Return that error while preserving watch registration before the initial read and subscription cleanup on every exit.
Member
|
Closed via #522. |
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.
ax watch task missingnow exits promptly withNotFound. Initial store lookup failures returnInternal. The subscription still registers before the initial lookup to avoid losing updates, and its deferred close covers every subsequent exit.Fixes #435.
This picks up vincent0426's offered patch, with coverage for the current main, and credits Yi-111-a's diagnosis and reproduction.
Validation on Go 1.27.1, Linux/amd64 (all final checks exited 0):
WatchTaskhas 100.0% statement coverage in the focused suite; 50 focused race repetitions passed. Missing-task and lookup-before-registration negative controls fail as expected.Prepared with an AI coding assistant.
Captured CLI/API output, detailed checks, and copyable Redis reproduction
Validation on Go 1.27.1, base
ac2332829f22360ff97b0ba34d94dd0dd782f17e:TestWatchTaskcoverage measures 100.0% statement coverage ofWatchTask, viago test -count=1 -run '^TestWatchTask' -coverprofile=watch.coverage ./internal/serverandgo tool cover -func=watch.coverage. This is a function measurement, not a package-wide claim.DeadlineExceededrather thanNotFound, exit 1. Fixed tests exit 0.DeadlineExceeded, exit 1, proving the test detects the lost-update gap.All commands above exited 0; no prerequisite skips or dependency changes. The formatter reports no files. The full contribution diff was reread.
The CLI/API proof used stock baseline and fixed
ax-serverbinaries, the actualaxCLI, and a disposable Redis 7.4.11 container. The baseline binary was built with a Go overlay restoring onlyinternal/server/server.gofrom main. No live Substrate sandbox or compatibility overlay was used: these watches exercise the AX API/storage boundary, with existing-task records seeded directly in isolated Redis.Captured baseline:
Captured fixed behavior:
The following standalone reproduction was also executed successfully. It requires Bash, Go, Docker, Python 3, curl, ripgrep, and GNU timeout; missing prerequisites fail rather than skip. It builds the binaries, starts only disposable local fixtures, checks missing and existing CLI watches, verifies subscriber cleanup, and tears down its processes/container. To observe the baseline hang, run the missing-watch command against main: timeout exits 124 instead of the fixed exit 1.
Copyable CLI/Redis reproduction