feat: Accept array-style Idempotency-Key headers on interactive deposit requests#159
Conversation
|
@Belzabeem 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! 🚀 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of the deposit route by allowing it to correctly interpret the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the idempotency key extraction in express-router.ts by introducing and utilizing IdempotencyUtils.extractIdempotencyHeader. This change also simplifies the idempotency key check from a type and length check to a null check. The review suggests applying this simplified check consistently to other relevant lines in the express-router.ts file. Additionally, new tests were added for the IdempotencyUtils, but some of them appear to be redundant with existing tests and could be removed to improve test suite maintainability.
|
@Belzabeem Please fix CI |
|
Hey @Belzabeem Please fix CI and conflict |
Exercise cleanupOldRecords with a cutoff timestamp: expired auth, idempotency, processed webhooks, and processed watcher rows are removed; non-eligible rows remain. Made-with: Cursor Co-authored-by: AI Assistant <test@example.com>
0xNgoo#190) * feat: implement configuration validation for database providers and URL formats with enhanced schema exports * fix ci * fix ci --------- Co-authored-by: augustine00z <cofoedum@gmail.com>
0xNgoo#189) * feat: implement AnchorConfig manager and ValidationUtils for SDK configuration and data sanitization * fix ci * Update validation.ts * feat: add validation utilities with tests, implement CI workflow, and update tsconfig include paths * fix ci --------- Co-authored-by: augustine00z <cofoedum@gmail.com> Co-authored-by: Paulie <113470324+0xNgoo@users.noreply.github.com>
|
I have fixed the CI and the conflicts |
Closes #94
The deposit route reads the idempotency header as a single string, but some frameworks can surface headers as arrays. This PR updates the deposit route so it can accept a non-empty Idempotency-Key value from either a string or a string array.
Changes
1. Updated src/runtime/http/express-router.ts
import { IdempotencyUtils } from '@/utils/idempotency.ts';2. Added focused tests in tests/utils/idempotency.test.ts
Added 5 new test cases:
extractIdempotencyHeader handles lowercase idempotency-key header nameextractIdempotencyHeader handles array idempotency-key with first non-empty valueextractIdempotencyHeader handles array idempotency-key with leading empty stringsextractIdempotencyHeader handles array idempotency-key with only empty valuesTest Results
Acceptance Criteria