oscerd commented on code in PR #27195:
URL: https://github.com/apache/camel/pull/27195#discussion_r4155830201
##########
components/camel-openfga/src/main/java/org/apache/camel/component/openfga/OpenFgaConstants.java:
##########
@@ -74,6 +74,14 @@ public final class OpenFgaConstants {
javaType = "String")
public static final String STORE_ID = HEADER_PREFIX + "StoreId";
+ @Metadata(label = "producer",
+ description = "The continuation token the readTuples or
readChanges page came back with, or absent when"
Review Comment:
Correct, and I verified it against a live server rather than taking it on
trust — probed OpenFGA 1.21.0 directly, paging a two-change log with
`page_size=1`:
```
page 1: changes=1 token="MDFNM1ZRSFlQVllHNVBDUFpNNjdIQko5RzZ8"
page 2: changes=1 token="MDFNM1ZRSFlQVllHNVBDUFpNNkE0RkVIREN8"
page 3: changes=0 token="MDFNM1ZRSFlQVllHNVBDUFpNNkE0RkVIREN8" <- same
token, empty page
page 4: changes=0 token="MDFNM1ZRSFlQVllHNVBDUFpNNkE0RkVIREN8"
```
And the Read API for contrast, which is what made the original wording wrong
rather than merely imprecise:
```
page 1: tuples=1 token="MXw="
page 2: tuples=1 token="" <- empty on the last page
```
So the description was right for `readTuples` and wrong for `readChanges`.
Reworded in `808b3526ee7a` close to your suggestion, and I split
`setContinuationToken`'s javadoc the same way.
What I deliberately did **not** do is make `readChanges` clear the header on
an empty page. For a change log that token is the bookmark the next poll
resumes from — dropping it would turn every poll into a full replay and break
incremental sync, which is worse than the doc bug. It stays, and an empty body
is the documented signal.
`readChangesKeepsTheTokenWhenNothingHasChanged` locks the component
behaviour, and `readChangesHandsTheTokenBackWhenTheLogIsExhausted` drains a
real container and asserts the token is still non-blank, so an OpenFGA upgrade
that changed this would fail a test rather than silently invalidate the docs.
_Claude Code on behalf of oscerd_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]