`/status?network=mainnet` is rate limited although `/status` is exempt
Maintainer thường phản hồi trong vòng 3 ngày
@Joyful12-tech đang làm issue này rồi.
Từ ngày 20/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu với phần miễn trừ probe trong src/app.ts và so sánh bước kiểm tra URL với bước kiểm tra đường dẫn đã định tuyến trong src/middleware/globalRateLimit.ts. Đọc src/__tests__/rateLimitContract.test.ts và tests/healthProbes.test.ts để tham khảo các mẫu kiểm thử. Bổ sung kiểm thử cho thấy các yêu cầu probe có query string vẫn được miễn trừ và một route thông thường vẫn trả về 429 khi giới hạn thấp; hoàn tất khi các trường hợp đó chạy qua với các giới hạn tốc độ hiện có được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
Health probes must never be throttled. src/app.ts says so at lines 55 to 62 and exempts them at line 174:
allowList: (req) => PROBE_PATHS.has(req.url),
req.url includes the query string. /status takes a network parameter (it reports per network), so a monitor that polls /status?network=mainnet does not match '/status', is counted against the shared per-IP limit of 100 a minute, and can be answered 429 during an incident. That is the exact failure the comment warns about.
The global ceiling next door does it right: src/middleware/globalRateLimit.ts line 44 compares the routed path, not the raw URL.
What to build
- Make the exemption match the route, not the raw URL, so any query string on
/status,/liveand/readyis still exempt. The/v1/...forms must be exempt too. - Do not exempt anything else. Do not change any limit value.
- Add tests that set a very low
RATE_LIMIT_IP_MAX, call/status?network=testnetmore times than the limit, and get no429; and that a normal route still gets429.
Where to look
src/app.tslines 62 and 168 to 186src/middleware/globalRateLimit.tsline 44src/__tests__/rateLimitContract.test.ts,tests/healthProbes.test.ts
Done when
-
/status,/liveand/readyare exempt with and without a query string, on bare and/v1paths - A non-probe route is still limited, proved by a test
- No rate limit, scope or CORS rule was removed or loosened
-
npm testpasses
Drips Wave · Complexity: Easy · 100 points
Repo: Divinity-Labs/Lens. Install with npm ci, typecheck with npx tsc --noEmit, test with npm test. Tests are vitest. Do not run jest: it reports zero tests and proves nothing.
You cannot reach the production service. Prove your change with local tests and fixtures. Mock the database (pgPool, prisma) the way the existing tests in src/__tests__/ and tests/ do.
Generated files are checked byte for byte by CI. If you add or change a route, edit openapi.yaml by hand and then regenerate the generated files and commit them: npm run openapi:gen (writes openapi.json and the README sections), npm run client:gen (the TypeScript client schema) and, if you touched the GraphQL schema, npm run graphql:schema:gen (writes schema.graphql). The full list is in the scripts section of package.json; also read CONTRIBUTING.md. If a check fails and the diff looks empty, it is line endings: commit with LF.
Prices are high-precision decimals. Do not add a new place where a price or amount goes through parseFloat, Number() or ::float before it reaches the caller.
MCP tools must return exactly the fields the matching REST route returns (tests/mcp-lens.test.ts asserts equality), and the MCP tool modules must not import the database driver directly. Reads are injected.
Do not remove or loosen an existing API-key scope, CORS rule or rate limit, and do not replace src/app.ts wholesale. Past pull requests did both by accident.
Do not weaken a test to make it pass. No real user data, wallet addresses of real users, keys, tokens or connection strings in code, tests or fixtures. Never shorten a Stellar address or contract id; copy it in full from the file that defines it.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
- Ngôn ngữ chính
- TypeScript
- Star
- 4
- Fork
- 71
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 24
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Divinity-Labs/Lens
-
area:database difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Divinity-Labs/Lens#688 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
`/price/:assetA/:assetB/history` turns a bad `limit` into a 500 and an unknown pair into an empty 200Có thể đã có người làm @I-frenzy đã nhận hôm nay. Đang mởarea:api difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Divinity-Labs/Lens#664 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Divinity-Labs/Lens#663 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area:ingest difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Divinity-Labs/Lens#633 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Webhook retries have no jitter, so failures synchroniseCó thể đã có người làm @Richard-tobi đã nhận 35 ngày trước. Đang mởarea:reliability difficulty:easy help wanted points:100 Stellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Divinity-Labs/Lens#341 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của Divinity-Labs/Lens
Issue tương tự
-
[功能请求] 设置选项语言调整Đang mở功能请求
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
antithesishq/bombadil#473 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
The structured output reference promises null results for refusals that carry validation detailsĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
mattermost/mattermost-mobile#10358 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ready-for-agent
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
LucasSantana-Dev/Lucky#3257 ·
Maintainer thường phản hồi trong vòng 1 ngày