Repository navigation
Conversation
This branch has not been deployed
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
The server supports editing only a document chunk's text or retrieval state, but the SDK's legacy update request has value fields: a text edit always sends
is_enabled:false, and an enable-only update sends an empty content string that the server rejects. This makes ordinary correction and enable/disable workflows unsafe without copying unrelated values first.Add
UpdateChunkFieldswith pointer-valued content, enabled state, and revision fields matching the server contract. Nil preserves a stored field; a pointer to false explicitly disables it; revision zero is transmitted when supplied. Reuse the existing request path/response handling and retain the legacy method's signature and behavior for compatibility. Both READMEs show reading the current revision and making an enable-only update.Testing
Three HTTP-transport cases exercise the real SDK method and the server's pointer-field decoding: content-only, disable-only, enable-only, omitted fields, and expected revision zero. All pass.
go test -count=1 ./...passes for the complete client module, and golangci-lint v2.12.2 reports zero diff-scoped issues.git diff --checkpasses. No live backend or paid model was used.Existing callers must opt into the new method for partial-update semantics; this PR deliberately does not change what legacy value fields mean.