Companion/extra-waypoint GPX imported without matching cache silently produces zero results, no warning
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 src/opensak/importer/__init__.py 开始:阅读 _insert_extra_wpts() 和 if cache_id is None: continue 分支,然后找到 import_gpx() 中构建 ImportResult 的位置。使用 tests/data.py 中的 SAMPLE_WPTS_GPX,在空数据库中复现,并确认结果没有警告。当该导入向 result.warnings 添加一条警告,说明有多少个航点没有匹配的缓存,并且导入器测试中有一个测试对此进行检查时,任务完成。
由索引模型根据 Issue 内容生成。
描述
Current State
Background
import_gpx() handles two kinds of GPX <wpt> entries: full geocache
records, and "extra" (child/companion) waypoints belonging to a parent cache
(type="Waypoint|..."). The latter are collected into extra_wpts during
parsing and linked to their parent via _insert_extra_wpts().
If a GPX file contains only extra waypoints — e.g. a companion
xxx-wpts.gpx from a Pocket Query with "Include Additional Waypoints", or
any file imported when its parent cache doesn't yet exist in the active
database — _insert_extra_wpts() silently drops them:
for suffix, wps in wpts_by_suffix.items():
cache_id = suffix_to_cache_id.get(suffix)
if cache_id is None:
continue # <-- silently discarded, no warning
get_import_type() (utils/utils.py) classifies purely by file extension, so
a companion-only GPX is indistinguishable from a normal cache GPX until
parsing — the user has no way to know which kind of file they picked.
Proposed Improvement
Reproduced
Imported a companion-only GPX (SAMPLE_WPTS_GPX from tests/data.py) into an
empty database:
created=0 updated=0 skipped=0 waypoints=0 errors=[]
No exception, no entry in result.errors, no entry in result.warnings
(the field exists and is already used by the LOC importer, just not here).
The import dialog shows a plain ✅ with all-zero counts — nothing to alert
the user that the file only contained orphaned child waypoints.
Expected Benefits
Expected behavior
When extra_wpts contains waypoints whose suffix has no matching cache,
append a message to result.warnings, e.g.:
"N waypoints found but no matching cache exists in the database.
Import the main cache GPX first."
so the existing warnings-display path in the import dialog surfaces it
instead of a silent all-zero success.
Where
src/opensak/importer/__init__.py, _insert_extra_wpts() (the
if cache_id is None: continue branch) and the caller in import_gpx()
where ImportResult is assembled.
- 主要语言
- Python
- 星标
- 37
- 派生
- 17
- 平均合并
- 21 小时 5 分钟
- 30 天内合并 PR
- 131
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenSAK-Org/OpenSAK 的其他 Issue
-
area: documentation documentation good first issue OS: windows
难度 2/5 半天 新手友好度 78/100
OpenSAK-Org/OpenSAK#1289 ·
维护者通常 1 天内回复
-
area: geo-data improvement
难度 2/5 1-3 小时 新手友好度 65/100
OpenSAK-Org/OpenSAK#1285 ·
维护者通常 1 天内回复
-
area: geo-data good first issue improvement
难度 2/5 1-3 小时 新手友好度 80/100
OpenSAK-Org/OpenSAK#789 · 1 条评论 ·
维护者通常 1 天内回复
-
area: UI improvement
难度 2/5 1-3 小时 新手友好度 62/100
OpenSAK-Org/OpenSAK#729 ·
维护者通常 1 天内回复
-
area: documentation improvement
难度 2/5 1-3 小时 新手友好度 62/100
OpenSAK-Org/OpenSAK#570 ·
维护者通常 1 天内回复
查看 OpenSAK-Org/OpenSAK 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
SACGF/variantgrid#2791 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
bot-triaged oncall: cpu inductor
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
kubescape/cel-admission-library#141 · 1 条评论 ·
维护者通常 1 天内回复