Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Angular Router numeric query parameters can exhaust memory during SSR

Đang mở
#70,908 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/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ệ
angular, node.js, typescript
Lĩnh vực
backend, performance, web-dev

Hướng nghiên cứu

The bug is in parseQueryParam() in the Angular Router package. Start by examining the router source code, particularly the query parameter parsing logic. The provided reproduction repository shows the memory issue during SSR. Look at how numeric query parameter names are handled differently in V8. Test changes by running the reproduction and verifying memory usage does not spike with numeric parameters.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: router gemini-triaged
Which @angular/* package(s) are the source of the bug?

router

Is this a regression?

No

Description

#70717 fixed the numeric matrix-parameter case from #70716, but query parameters still use regular object assignment in parseQueryParam():

params[decodedKey] = decodedVal;

Numeric query parameter names therefore still behave differently in V8.

For example:

?0&17&34

is parsed as:

{
  "0": "",
  "17": "",
  "34": ""
}

In my test this object retained around 558 KB, while a similar nonnumeric control retained around 197 KB.

The Router copies this map when creating URLs. An application can enable this globally with:

withRouterConfig({
  defaultQueryParamsHandling: 'merge',
})

so during SSR the cost is repeated for every RouterLink rendered on the page.

I tested Angular 22.2.0 on Node.js 24 through Nginx with a 16,365-byte request line containing 2,827 parameter names:

Links 256 MiB 512 MiB
30 16 requests
50 8 requests 20 requests
75 6 requests 12 requests
100 4 requests 10 requests

The byte-identical nonnumeric control completed successfully.

For comparison, the original matrix-parameter case on Angular 22.1.4 also required 4 requests at 256 MiB and 10 requests at 512 MiB with 100 links.

All failures were V8 heap OOMs:

OOMKilled=false
Please provide a link to a minimal reproduction of the bug

https://github.com/SkyZeroZx/angular-router-ssr-oom-lab/tree/query-param-oom-angular-22.2.0

Ngôn ngữ chính
TypeScript
Star
101k
Fork
28.1k
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
307

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/angular

Tất cả issue của angular/angular

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.