-
Notifications
You must be signed in to change notification settings - Fork 23
Merge pull request #69 from Ahbiz/feature/non-custodial-refunds feat(stellar): implement non-custodial refund and dispute flow (#62) #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
903436e
feat(stellar): add path payment support with quote endpoint and slipp…
abimbolaalabi 78c4c61
Merge branch 'main' into feat/path-payment
abimbolaalabi 77543bb
fix: resolve duplicate export and add asset issuer validation
abimbolaalabi ca44979
fix: resolve rebase conflict artifacts in paymentController.js
abimbolaalabi 8cfa18e
Merge pull request #40 from abimbolaalabi/feat/path-payment
zeemscript ba285b7
feat(jobs): add durable background processing
Dayz-tech-co 2866f7b
Merge pull request #41 from Dayz-tech-co/feat/32-background-jobs
zeemscript 491c734
feat: add pre-flight payment safety checks with SEP-29 memo detection
Tijesunimi004 768029d
Merge pull request #68 from Tijesunimi004/feat/preflight-payment-safe…
zeemscript 0146810
implemented non-custodial refund and dispute flow (#62)
Ahbiz 9450672
chore: add retrying to Transaction status enum
Ahbiz 7dcaa36
chore: resolve merge conflict with upstream/dev (keep refunded/disput…
Ahbiz ec82ab6
fix: remove Mongoose session/transaction from submitRefund for standa…
Ahbiz bd0487a
Merge pull request #69 from Ahbiz/feature/non-custodial-refunds
zeemscript 2799ef6
feat: cache POST-based recommendation endpoints and document cache layer
Tijesunimi004 8a841fe
Merge branch 'dev' into feat/19-wire-up-redis-cache-layer
Tijesunimi004 769e0c9
fix: repair stellarPaymentController mock drift and ESM export mismatch
Tijesunimi004 65229da
Merge pull request #71 from Tijesunimi004/feat/19-wire-up-redis-cache…
zeemscript cae9ec3
feat: media upload hardening with limits, magic bytes, and signed del…
Kaycee276 e276d78
Merge branch 'dev' into fix/67-media-upload-hardening
Kaycee276 2138e57
Merge pull request #73 from Kaycee276/fix/67-media-upload-hardening
zeemscript ac2b1bb
feat(search): add full-text search API with text indexes, ranking, fi…
Kaycee276 af64f16
feat(stellar): publish SEP-1 stellar.toml metadata endpoint at /.well…
Ahbiz c0811db
fix(stellar): address CodeRabbit review feedback for SEP-1 stellar.toml
Ahbiz ecbeddd
Merge pull request #75 from Ahbiz/feature/sep1-stellar-toml
zeemscript 4291c51
fix: env-aware refresh token cookie settings for local dev
zeemscript a6d5826
feat(notifications): wire producers, batched fan-out, redis pubsub, p…
sublime247 55b9551
Merge branch 'dev' into dev
sublime247 2827f8a
fix(notifications): restore notification controller imports in book, …
sublime247 d4ed338
feat(auth): align canonical role enum, authorize middleware, anti-esc…
sublime247 57c9c27
Merge pull request #77 from sublime247/feature/roles-and-authorization
zeemscript 0b34c14
refactor: standardize API response structure, improve search service …
Kaycee276 bb1f3be
Merge branch 'dev' into feat/64-full-text-search
Kaycee276 45c5382
refactor: centralize test environment configuration and add authoriza…
Kaycee276 df10742
Merge remote-tracking branch 'origin/feat/64-full-text-search' into f…
Kaycee276 f3d5e9f
refactor: use stored testUserId in upload.test.js to simplify user up…
Kaycee276 1f673ff
chore: implement dynamic environment variable loading from .env.test …
Kaycee276 f85f1df
refactor: use cloudinary configuration object instead of process.env …
Kaycee276 f6db82f
fix: add cloudinary test env variables to CI and strict assertion
Kaycee276 f22bdb8
Merge pull request #74 from Kaycee276/feat/64-full-text-search
zeemscript File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,36 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Dependency directories | ||
| node_modules/ | ||
| jspm_packages/ | ||
|
|
||
| # Environment variables | ||
| .env | ||
|
|
||
| # Build output | ||
| dist/ | ||
| build/ | ||
|
|
||
| # IDE files | ||
| .vscode/ | ||
| .DS_Store | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Dependency directories | ||
| node_modules/ | ||
| jspm_packages/ | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.test | ||
|
|
||
| # Build output | ||
| dist/ | ||
| build/ | ||
|
|
||
| # IDE files | ||
| .vscode/ | ||
| .DS_Store | ||
|
|
||
| # Spec & Agent temporary docs | ||
| Tasks.md | ||
| Memory.md | ||
| Handoff.md | ||
| PRD.md | ||
| Architecture.md | ||
| scratch/ |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Redis Caching | ||
|
|
||
| This documents which endpoints are cached, their TTLs, and the invalidation | ||
| strategy. The underlying helpers live in `src/utils/cache.js` (Redis | ||
| primitives, `CACHE_TTL`/`CACHE_KEYS` presets) and `src/middlewares/cache.js` | ||
| (`cacheMiddleware`, `smartCache`, `invalidateCacheMiddleware`). | ||
|
|
||
| All caching degrades gracefully: `getCache`/`setCache`/`deleteCachePattern` | ||
| check `isRedisReady()` first and no-op (falling through to Mongo) when Redis | ||
| is unavailable, so a down Redis instance never breaks a request. | ||
|
|
||
| ## Cached read endpoints | ||
|
|
||
| | Endpoint | Cache key | TTL | Notes | | ||
| |---|---|---|---| | ||
| | `GET /api/books` | `books:list` | 15 min (`CACHE_TTL.BOOKS`) | | | ||
| | `GET /api/books/:id` | `book:<id>` | 15 min | | | ||
| | `GET /api/books/by-author/:authorId` | `books:author:<authorId>` | 15 min | | | ||
| | `GET /api/books/recom` | `books:recommended` | 3 min (`CACHE_TTL.SHORT`) | shared key regardless of `interests`; the controller (`fetchRecommendedBooks`) also has a pre-existing bug (undefined `category` reference) that makes it non-functional today - out of scope here | | ||
| | `POST /api/books/recommended` | `books:recommended:<sorted interests \| "popular">` | 15 min (`CACHE_TTL.BOOKS`) | added in this change; keyed explicitly in the controller since `cacheMiddleware` only intercepts GET | | ||
| | `GET /api/courses` | `courses:list` | 15 min (`CACHE_TTL.COURSES`) | | | ||
| | `GET /api/courses/:id` | `course:<id>` | 15 min | | | ||
| | `GET /api/courses/user` | `courses:user:<createdBy>` | 15 min | | | ||
| | `POST /api/courses/recommended` | `courses:recommended:<sorted interests \| "none">` | 15 min (`CACHE_TTL.COURSES`) | added in this change; previously explicitly left uncached ("POST routes not cached") | | ||
| | `GET /api/spaces` | `spaces:list` | 5 min (`CACHE_TTL.SPACES`) | | | ||
| | `GET /api/spaces/:id` | `space:<id>` | 5 min | | | ||
| | `GET /api/spaces/by-host/:hostId` | `spaces:host:<hostId>` | 5 min | | | ||
| | `GET /api/search` | `search:<type>:<q>` | 5 min (`CACHE_TTL.SEARCH`) | | | ||
| | `GET /api/users/:id` | `user:<id>` | 10 min (`CACHE_TTL.USERS`) | | | ||
| | `GET /api/users/recommendations` | `user:<requester id>:recommendations` | 10 min | keyed per requesting user | | ||
| | `GET /api/users/:userId/followers` | `user:<userId>:followers` | 10 min | | | ||
| | `GET /api/users/:userId/following` | `user:<userId>:following` | 10 min | | | ||
|
|
||
| The books/courses/spaces/search/users list and detail endpoints above were | ||
| wired up separately (see `feat: configure Redis cache layer for production | ||
| use`, merged to `main`). This change adds the two `POST /recommended` | ||
| entries, which that work left uncached, plus this document. | ||
|
|
||
| ## Invalidation | ||
|
|
||
| Writes call `invalidateCacheMiddleware` with wildcard patterns so a create, | ||
| update, delete, or review clears the relevant cached list/detail entries | ||
| (`deleteCachePattern` runs a Redis `KEYS` scan against the pattern): | ||
|
|
||
| - Books: `createBook` invalidates `books:*`; `deleteBook` and `addBookReview` invalidate `books:*` and `book:*`. | ||
| - Courses: `createCourse` invalidates `courses:*`; `enrollInCourse`/`addCourseReview` invalidate `course:*`; `updateCourse` invalidates `courses:*` and `course:*`. | ||
| - Spaces: `createSpace` invalidates `spaces:*`; `joinWaitList` invalidates `space:*`; `updateSpace`/`deleteSpace` invalidate `spaces:*` and `space:*`. | ||
| - Users: profile/follow writes invalidate `user:*` (and `user:*:followers` / `user:*:following` on follow/unfollow). | ||
|
|
||
| `books:*` and `courses:*` also cover the new `books:recommended:*` / | ||
| `courses:recommended:*` keys added in this change, since they share the same | ||
| prefix - no separate invalidation wiring was needed for them. | ||
|
|
||
| Search has no dedicated invalidation hook (it spans five collections); its | ||
| 5-minute TTL is the staleness bound instead. | ||
|
|
||
| ## Deliberately not cached | ||
|
|
||
| - **Bookmarks** (`GET /api/books/bookmarks`, `GET /api/courses/bookmarks`, | ||
| and the `bookmark/check` routes) are per-user and are left uncached rather | ||
| than risk leaking one user's bookmark state into another user's response | ||
| under a shared key. | ||
| - **Reels** (`GET /api/reels`, `GET /api/reels/:id`) embed the requesting | ||
| user's `viewerState` (liked/loved) directly in each reel object. Caching | ||
| the response as-is would leak one viewer's like/love state to every other | ||
| viewer who hits the same cache key, so these are left uncached until the | ||
| response shape separates viewer-specific state from the shared reel data. | ||
|
|
||
| ## User-specific data | ||
|
|
||
| `cacheMiddleware`/`smartCache` support a per-request key generator (and | ||
| `smartCache`'s `includeUser` option) for endpoints that must vary per user - | ||
| see `GET /api/users/recommendations` above, which folds the requester's id | ||
| into the key. Any future authenticated, user-specific GET endpoint should do | ||
| the same rather than caching under a shared key. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export default { | ||
| testEnvironment: "node", | ||
| transform: {}, | ||
| setupFiles: ["<rootDir>/test/jest.setup.js"], | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Remove the duplicate EmailJS entries.
These keys already exist at Lines 22-26. Because dotenv resolves duplicate keys by the later value, editing the first EmailJS block will be silently overridden by these placeholders, causing mail configuration failures. Keep only one EmailJS block and add
EMAILJS_RECEIPT_TEMPLATE_IDbeside the existing template ID.🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 29-29: [DuplicatedKey] The EMAILJS_PRIVATE_KEY key is duplicated
(DuplicatedKey)
[warning] 30-30: [DuplicatedKey] The EMAILJS_PUBLIC_KEY key is duplicated
(DuplicatedKey)
[warning] 31-31: [DuplicatedKey] The EMAILJS_SERVICE_ID key is duplicated
(DuplicatedKey)
[warning] 32-32: [DuplicatedKey] The EMAILJS_TEMPLATE_ID key is duplicated
(DuplicatedKey)
[warning] 33-33: [UnorderedKey] The EMAILJS_RECEIPT_TEMPLATE_ID key should go before the EMAILJS_SERVICE_ID key
(UnorderedKey)
🤖 Prompt for AI Agents
Sources: Path instructions, Linters/SAST tools