getPod() assumes subdomain pattern, breaks path-based pods
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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- authentication
Hướng nghiên cứu
Bắt đầu với getPod() trong src/utils/headerFooterHelpers.ts và kiểm tra cách authn.currentUser(), dữ liệu WebID và storage khả dụng trong các tiện ích xung quanh. Xác minh hành vi với một pod dựa trên đường dẫn, chẳng hạn như http://server.com/alice/, và giữ nguyên fallback dựa trên origin hiện có cho các pod miền phụ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The getPod() function in src/utils/headerFooterHelpers.ts assumes pods are at the origin (subdomain pattern), which breaks path-based pod servers.
Current code (line 17-20):
export function getPod (): NamedNode {
// @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers
return sym(document.location.origin).site()
}
The TODO comment acknowledges this limitation.
Impact
When using a path-based pod server (e.g., http://server.com/alice/), after login:
- WebID:
http://server.com/alice/profile/card#me✓ getPod()returns:http://server.com/✗- Profile guess becomes:
http://server.com/profile/card#me✗ - Should be:
http://server.com/alice/profile/card#me✓
This causes 404 errors when mashlib tries to load the user's profile.
Affected Servers
- Any path-based pod server
- CSS (Community Solid Server) supports both subdomain and path patterns
- JSS (JavaScript Solid Server) uses path pattern
Suggested Fix
Derive the pod root from the logged-in user's WebID rather than assuming document.location.origin:
export function getPod (): NamedNode {
const user = authn.currentUser()
if (user) {
// Extract pod root from WebID's pim:storage or by convention
const storage = getStorage(user)
if (storage) return storage
}
// Fallback to origin-based (subdomain pattern)
return sym(document.location.origin).site()
}
Or use the pim:storage triple from the user's profile which explicitly declares the pod root.
Environment
- solid-ui version: latest (via mashlib CDN)
- Server: JSS (JavaScript Solid Server) with path-based pods
- Ngôn ngữ chính
- TypeScript
- Star
- 153
- Fork
- 46
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 7
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 SolidOS/solid-ui
-
enhancement
-
enhancement
-
Vite warning Đang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
enhancement
Tất cả issue của SolidOS/solid-ui
Issue tương tự
-
Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenNSW/nsw-srilanka#497 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
digidem/comapeo-cloud-app#403 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100