feat: add HTTP cache decorators to list endpoints and fix E2E test suite#369
Open
Kend07 wants to merge 4 commits into
Open
feat: add HTTP cache decorators to list endpoints and fix E2E test suite#369Kend07 wants to merge 4 commits into
Kend07 wants to merge 4 commits into
Conversation
Contributor
|
Awesome work on this! Thanks for the contribution 🚀 Merging now. |
Contributor
|
Hi 👋 Thanks for this PR! There are some merge conflicts with the current main. Could you rebase onto main and push when you have a moment? Once it's clean we'll get it merged 🚀 |
Author
|
Good Morning, I see, of course. I'll rebase into main ASAP, I will be available for it in some hours, thank you! |
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
Closes #240
HTTP Cache decorators applied to all list endpoints + E2E test fixes
HTTP Caching Implementation
Added @HttpCacheTtl(30) to findAll() endpoints on three controllers:
campaigns.controller.ts - GET /campaigns and GET /campaigns/:id
claims.controller.ts -GET /claims
audit.controller.ts -GET /audit
Testing
E2E tests assert:
First GET returns Cache-Control: max-age=30, private
Second GET with If-None-Match (ETag) returns 304 Not Modified with X-Edge-Cache-Status: hit
E2E Test Fixes
app/backend/.env -REDIS_HOST=127.0.0.1 (previously: 172.18.38.173)
Redis protected mode blocked non-loopback connections; loopback works from within WSL2
app/backend/test/claims.e2e-spec.ts -- Full rewrite:
Encrypt recipientRef before Prisma insert (service decrypts on read)
Add required tokenAddress (Stellar address) to POST bodies
POST state transitions expect 201, PATCH expects 200
Response body is raw object (no { success, data } wrapper)
Removed budget-over-cap test (feature not implemented)
Results
E2E: 21/21 passing (campaigns 8/8, claims 11/11, audit 2/2)
Unit: 44/45 suites, 437/447 passing (idempotency failure pre-existing, needs PG)
Hello ChainForge Team,
All the protocol checks for the PR have been approved, went to some trouble with the ESLint config, but it is now fixed and ready. The pull request was updated due to trouble with the GrantFox OSS and platform, it its working as expected now.
Check the previous comment for more details of what was done. but in summary:
Issue was completed successfully.