getPod() assumes subdomain pattern, breaks path-based pods
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 153
- Forks
- 46
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 7
Descripción
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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con getPod() en src/utils/headerFooterHelpers.ts e inspecciona cómo están disponibles authn.currentUser(), los datos de WebID y storage en las utilidades circundantes. Verifica el comportamiento con un pod basado en una ruta, como http://server.com/alice/, y conserva el fallback existente basado en el origen para los pods de subdominio.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- authentication
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100