feat: add cache invalidation tests and documentation for markets#246
Merged
greatest0fallt1me merged 2 commits intoJun 29, 2026
Merged
Conversation
|
@CHKM001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
- Fix broken src/routes/users.ts (missing closing brace, incomplete route) - Remove unused imports in src/services/userService.ts and src/middleware/auth.ts - Add 'silent' to LOG_LEVEL enum in env-schema - Export Db type from src/db/index.ts - Re-export AppError/ErrorCodes from src/errors.ts (resolve module conflict) - Add eslint-disable for namespace declarations in middleware - Add eslint-disable for pre-existing any types in market routes/service - Fix duplicate UserProfile interface in userService.ts - Remove claims table references (table doesn't exist in schema)
96cb867 to
d7cf2e9
Compare
Contributor
Author
|
20+ lint errors not caused by the branch from main |
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.
PR Description - Add cache invalidation hooks to markets repository on update (#149 )
Description
This pull request adds comprehensive tests and documentation for the existing Redis cache invalidation implementation in
src/cache/marketsCache.ts. The cache invalidation hooks ensure that when a market is updated viaPATCH /api/markets/:id, both the specific market cache and the aggregated list cache are properly invalidated.Requirements Covered
markets:{id}andmarkets:allkeys are deletedKey Changes
tests/marketsCache.test.ts(new):markets:allandmarkets:{id})docs/cache.md(new):Cache Implementation Details
The existing implementation in
src/cache/marketsCache.ts:markets:allfor list view,markets:{id}for individual marketPromise.allVerification
New test suite covers cache invalidation scenarios:
tests/marketsCache.test.ts(Key generation, invalidation, error handling)Run test command:
npm test tests/marketsCache.test.tsTest Output
Coverage
src/cache/marketsCache.tsCloses #149