feat: DateModified + delta API endpoints (#121)#130
Merged
Conversation
8 integration tests documenting the expected modifiedAfter filter contract for Issue #121 (DateModified on Post/Note + delta query param). Posts (GET /api/posts/?modifiedAfter=): - ReturnsOnlyRecentPosts - FutureTimestamp_ReturnsEmpty - WithoutModifiedAfter_ReturnsAllPosts (non-breaking baseline) - MultipleResults (3 posts, threshold filters to 2) Notes (GET /api/notes/?modifiedAfter=): - Same 4 patterns Tests are intentionally RED until Han's implementation lands. Timing-based seeding: Task.Delay(150ms) + DateTime.UtcNow threshold ensures the server clock reliably separates old vs new entities. Assertions use RowKey presence/absence for test isolation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add DateModified (DateTime UTC) to Post, Note, PostL domain models
- Post.DateModified defaults to DateTime.UtcNow to ensure valid UTC for Azure SDK
- Note constructor sets DateModified = DateTime.UtcNow
- DataStorageService.SavePost and CreateNote set DateModified = DateTime.UtcNow on every write
- GET /api/posts/?modifiedAfter={ISO8601} filters unread posts by DateModified (non-breaking)
- GET /api/posts/read?modifiedAfter={ISO8601} filters read posts by DateModified (non-breaking)
- GET /api/notes/?modifiedAfter={ISO8601} filters notes by DateModified (non-breaking)
- PATCH /api/posts/{id} endpoint added — updates post and refreshes DateModified
- PATCH /api/notes/note/{rowKey} endpoint added — updates note and refreshes DateModified
- 12 new integration tests in DeltaApiTests covering modifiedAfter filtering and PATCH semantics
- All 20 delta tests pass (8 Biggs proactive + 12 new endpoint tests)
Closes #121
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds
DateModified(UTC timestamp) toPostandNotedomain models, and extends GET list endpoints with an optionalmodifiedAfterquery parameter for mobile delta sync.Changes
Domain
Post.DateModified—DateTimeUTC, defaults toDateTime.UtcNow(Azure SDK requires UTC)Note.DateModified—DateTimeUTC, set in constructorPostL.DateModified— exposed in list responsesAPI
GET /api/posts/?modifiedAfter={ISO8601}— filters unread posts byDateModified(non-breaking)GET /api/posts/read?modifiedAfter={ISO8601}— filters read posts byDateModified(non-breaking)GET /api/notes/?modifiedAfter={ISO8601}— filters notes byDateModified(non-breaking)PATCH /api/posts/{id}— updates post, setsDateModified = DateTime.UtcNowPATCH /api/notes/note/{rowKey}— updates note, setsDateModified = DateTime.UtcNowStorage
DataStorageService.SavePostsetsDateModified = DateTime.UtcNowon every writeDataStorageService.CreateNotesetsDateModified = DateTime.UtcNowon every writemodifiedAfter(safe across all Azure Table Storage tiers)Tests
DeltaApiTests.csCloses #121