Too many requests when clicking on a resource for the first time or initially
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lần nhấp vào tài nguyên đầu tiên hoặc lần tải lại trang đầu tiên với thiết lập HydraAdmin, hydraDataProvider, httpClient tùy chỉnh và apiDocumentationParser được cung cấp, sau đó kiểm tra dấu vết mạng của trình duyệt. Theo dõi các request ban đầu qua data provider và các điểm vào của frontend; được xem là hoàn tất khi việc tải tài nguyên ban đầu không còn tạo ra các request trùng lặp không thể giải thích trong môi trường development hoặc production.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
API Platform version(s) affected: x.y.z
Backend
v3.3.12
Frontend
"@api-platform/admin": "^4.0.1",
Description
When I click on a resource for the first time a lot of requests will fire. Here I reload the page on a specific resource (http://localhost:3000/#/locations). We also tested in prod mode.
Dev Mode
Prod Mode
How to reproduce
Its a simple example. I just use a custom httpClient to set a header for the authorization (jwt).
import { HydraAdmin, hydraDataProvider } from "@api-platform/admin";
import { parseHydraDocumentation } from "@api-platform/api-doc-parser";
import { ENTRYPOINT } from "./constants/entrypoint";
import MyHeaders from "./constants/headers";
import httpClient from "./components/HttpClient";
// Replace with your own API entrypoint
// For instance if https://example.com/api/books is the path to the collection of book resources, then the entrypoint is https://example.com/api
const apiDocumentationParser = () => async () => {
try {
return await parseHydraDocumentation(ENTRYPOINT, {
headers: MyHeaders
});
} catch (result) {
// @ts-ignore
const { api, response, status } = result;
if (status !== 401 || !response) {
throw result;
}
return {
api,
response,
status,
};
}
};
const dataProvider = hydraDataProvider({
entrypoint: ENTRYPOINT,
httpClient: httpClient,
apiDocumentationParser: apiDocumentationParser(),
useEmbedded: false,
});
export default () => (
<HydraAdmin dataProvider={dataProvider} />
);
Additional Context
- Ngôn ngữ chính
- TypeScript
- Star
- 516
- Fork
- 134
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 api-platform/admin
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
api-platform/admin#616 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
api-platform/admin#660 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
api-platform/admin#659 · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
api-platform/admin#631 · 6 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
api-platform/admin#626 · 1 bình luận · 1 reaction ·
Tất cả issue của api-platform/admin
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100