Collection edit: edited links/providers keep unknown fields; preview shows the merged save (#102 follow-up)

Abierto
#124 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
python, typescript

Línea de trabajo

Start with app/src/lib/stac-api/collectionEdit.ts and its merge tests in app/src/__tests__/collection-edit-merge.test.ts; compare how assets merge by key with links and providers. Then inspect the preview in app/src/components/collections/CollectionForm.tsx and the Zod schemas in app/src/lib/stac-api/schemas.ts. Done means edited entries retain stored unknown fields, the preview reflects the saved merge or is clearly labeled, and the re-read/PUT race is either documented in docs/ISSUES.md or scoped for conditional writes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug ready

Follow-up from #102 / PR #117. Saving Edit product now re-reads the stored document and three-way merges it (app/src/lib/stac-api/collectionEdit.ts), so untouched fields and unknown keys survive. Three gaps were left on purpose and listed in PR #117's "Known limits":

Acceptance criteria

  • An edited link or provider keeps its unknown fields. The form's Zod schemas (stacLinkSchema, stacProviderSchema in app/src/lib/stac-api/schemas.ts) strip unknown fields. When the user changes any link or provider, the merge takes the form's whole array, so every entry loses fields like a link's method/body/headers or extension fields. Untouched arrays are fine because they keep the stored copy. Merge per entry, the way assets already merge per key: lay each edited entry over the stored one, matched by index or by href+rel for links and name for providers.
  • The JSON preview shows what will be saved. The sidebar preview renders formToStacCollection(watch()), not the merged document, so on an edit it hides the keys that will be kept (cube:dimensions, item_assets, ...). Either preview the merge against the loaded document (no re-read needed for the preview), or label the preview as "fields this form edits".
  • Decide on the re-read/PUT race. A pipeline publish that lands between the re-read and the PUT (milliseconds) can still be overwritten; the next commit or the hourly maintenance republish (Z-6) repairs a cube collection. Closing the gap needs a conditional write (ETag / If-Match) through the BFF, which stac-fastapi-pgstac doesn't offer today. Either record it as an accepted limitation in docs/ISSUES.md, or scope the conditional write.

Files in scope

app/src/lib/stac-api/collectionEdit.ts, app/src/components/collections/CollectionForm.tsx, app/src/__tests__/collection-edit-merge.test.ts, docs/ISSUES.md (for the third item, if accepted).

Lenguaje dominante
Python
Estrellas
0
Forks
2
Merge medio
8 h 26 min
PR fusionados (30 d)
47

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TechTraverse/stac-higher

Todos los issues de TechTraverse/stac-higher

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.