Changes API: Use content_last_updated instead of last_updated#3101
Changes API: Use content_last_updated instead of last_updated#3101
Conversation
The Changes API now queries and sorts by content_last_updated so that metadata-only changes (nav reordering, mapping rollovers) no longer surface in the feed. The API response shape is unchanged — lastUpdated is still the JSON field name — keeping this non-breaking for consumers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis change updates the changes-feed cursor tracking mechanism to use Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/api/Elastic.Documentation.Api.Core/Changes/ChangesUsecase.cs`:
- Line 85: The cursor serialization currently writes only the
content_last_updated value
(writer.WriteNumberValue(cursor.ContentLastUpdatedEpochMs)) which keeps the old
2-element payload shape and causes mixed-semantics pagination across
deployments; change the cursor format to include an explicit version token
(e.g., emit a small object or array with a leading version number) when
serializing in ChangesUsecase.cs and update the corresponding deserialization
logic to branch on the version: if version==1 parse the new shape, if missing or
legacy shape, detect and map the old 2-element payload (last_updated) into the
new versioned structure so older cursors are handled safely without semantic
mixups. Ensure all code paths creating/reading cursors reference the new
versioned format and increment the version when semantics change next time.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a7511661-1bd6-4de0-a168-13fb6f39d65d
📒 Files selected for processing (3)
src/api/Elastic.Documentation.Api.Core/Changes/ChangesUsecase.cssrc/api/Elastic.Documentation.Api.Core/Changes/IChangesGateway.cssrc/services/Elastic.Documentation.Search/ChangesGateway.cs
What
Switch the Changes API to query
content_last_updatedinstead oflast_updated.Why
After #3016 introduced
content_last_updated, the Changes API should use it so that metadata-only changes (nav reordering, mapping rollovers) no longer surface in the feed.How
ChangesGatewaynow queries, sorts, and sourcesContentLastUpdatedChangedPageDto.LastUpdatedstill exists with the same JSON name — the mapping just reads from the new fieldContentLastUpdatedEpochMs(opaque to consumers)Test plan
/changes?since=<date>and verify only content changes appear🤖 Generated with Claude Code