Repository navigation
Conversation
Signed-off-by: AC <[email protected]>
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.
What type of PR is this?
Description
Decoding
{"duration_in_seconds":0}into aJSONAttachmentwhose duration is already five seconds leaves the old five-second value intact. This affects callers that reuse an attachment while reading updated JSON.Use an optional numeric field in the decoding helper so explicit zero resets the duration, while missing/null values preserve it. Fractional seconds and the existing treatment of negative values remain covered by tests.
Related Tickets & Documents
All-state searches found no report or fix for this decoding behavior. #121 addresses marshaling attachment values in seconds; this fixes decoding into an existing attachment and changes no marshaling code.
Added/updated tests?
Run verifications and test
make verifypasses (golangci-lint, gosec, govulncheck).make testpasses with the race detector, 92.7% statement coverage.Tests/security checks used Go 1.27.1 on Linux arm64. The lint executable is a wrapper running golangci-lint v1.64.8 under Go 1.24.13 with CGO disabled, because v1 lint cannot read Go 1.27 export data and the Go 1.24 CGO linker expects unavailable ld.gold. This is not a claim to have run the upstream Go 1.20/1.21, macOS or Windows matrix. govulncheck reports no reachable vulnerabilities; it notes advisories in imported packages/modules outside the detected call paths.
AI assistance: prepared and tested with Codex.