"Mark as Not Found" should remove the log entry created by "Mark as Found"
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Start in cache_table.py at the found/not-found handler and at the session.add(Log(...)) call in the Mark as Found path, which leaves log_id unset. Check importer/__init__.py and gsak_importer.py to confirm imported logs always carry a log_id. Done when Mark as Not Found deletes only logs matching the current finder, a type in FOUND_LOG_TYPES, and log_id is None, and decrements found_log_count.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Current State
"Mark as Found" creates a Log row (type "Found it"/"Attended", finder = the
configured username) when a cache is manually marked found. "Mark as Not
Found" currently clears cache.found/cache.found_date but deliberately
leaves that Log row in place — see the comment in
cache_table.py's found/not-found handler:
It deliberately does NOT touch existing Log rows though: deleting/
rewriting log history risks destroying real, imported found logs (e.g. a
genuine earlier find from before this cache was re-marked), and there's
no reliable way to tell "the log this feature created" apart from "a real
imported log" well enough to safely delete just the former.
That caution turned out to matter beyond just the UI: #766 (found status not
surviving GPX round-trips) had to add an explicit guard so a stale log left
behind by an unmark doesn't get misread as "found" again on re-export/
re-import. The guard fixes the symptom, but the stale log itself is still
sitting in the database, which is confusing (a cache correctly showing "not
found" that still has a "Found it" log entry if you open its Logs tab) and
still slightly fragile (e.g. it would appear in the log list / log count
displayed elsewhere in the UI).
Proposed Improvement
The "no reliable way to tell them apart" concern turns out to be solvable
without a schema change: Log.log_id is only ever None for logs created
by this feature. Every import path — GPX (importer/__init__.py) and
GSAK database (gsak_importer.py) — always sets a real log_id (the GC.com
log GUID, or f"{gc_code}_{lLogId}" for GSAK-DB imports). "Mark as Found"
is the only code path that creates a Log row with log_id left unset
(see cache_table.py, the session.add(Log(...)) call — no log_id is
passed).
So "Mark as Not Found" can safely delete the found-type log it's clearing,
as long as it also checks log_id is None — i.e. only delete a log that:
- matches the current user (
finder_id/finderagainst
gc_finder_id/gc_username, same matching already used elsewhere), AND - has
log_typeinFOUND_LOG_TYPES, AND - has
log_id is None(proof it was created by this feature, not imported).
Any real imported found log — which always has a log_id — is left
untouched, even if it happens to belong to the current user. This should
fully resolve the original concern without needing to guess.
Notes
found_log_countshould be decremented (not just left stale) when the
log is removed, mirroring the increment that happens on creation.- Once this ships, the #766
sym is None-only fallback guard technically
becomes less likely to ever see a stale log in practice for OpenSAK's own
exports — but it should stay in place regardless, since third-party GPX
sources (GSAK, etc.) can still legitimately omit<sym>and it's cheap
insurance either way.
Expected Benefits
No response
- Lenguaje dominante
- Python
- Estrellas
- 37
- Forks
- 17
- Merge medio
- 16 h 7 min
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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.
Más de OpenSAK-Org/OpenSAK
-
Make it clear that the Windows ZIP download is portable (no installer, not in Apps & Features)Abiertoarea: documentation documentation good first issue OS: windows
Dificultad 2/5 Medio día Aptitud para principiantes 78/100
OpenSAK-Org/OpenSAK#1289 ·
Los mantenedores suelen responder en 1 día
-
area: geo-data improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
OpenSAK-Org/OpenSAK#1285 ·
Los mantenedores suelen responder en 1 día
-
area: geo-data good first issue improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
OpenSAK-Org/OpenSAK#789 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area: UI improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
OpenSAK-Org/OpenSAK#729 ·
Los mantenedores suelen responder en 1 día
-
area: import improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
OpenSAK-Org/OpenSAK#648 ·
Los mantenedores suelen responder en 1 día
Todos los issues de OpenSAK-Org/OpenSAK
Issues similares
-
area: providers/aws priority: p2 size: S type: bug type: testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
finos/open-resource-broker#851 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
sandialabs/atlas-ui-3#1196 ·
Los mantenedores suelen responder en 1 día
-
enhancement triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ShaftHQ/SHAFT_ENGINE#7902 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: GraphML export writes invalid XML when a value contains a control character (e.g. form feed)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
topoteretes/cognee#6646 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
DOI-USGS/pywatershed#428 ·