Mapper: Context is saved but the API never returns it, so the next save erases it

未关闭
#2,930 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
django, javascript, python
领域
api, backend

调研方向

Start in core/map_projects/serializers.py and trace MapProjectSerializer, MapProjectDetailSerializer and the create/update serializer; then inspect MapProject.jsx to follow how Context is loaded and saved. Check whether Create similar copies configurations, including the configurations/ path named in the issue. Add coverage for saving Context, reading it after reload and saving again; done when the API returns the saved description and the round trip preserves it.

由索引模型根据 Issue 内容生成。

描述

component/api component/mapper decision/human-review signal/needs-human signal/quick-win signal/small-scope signal/well-specified stage/triaged type/bug

Found on production (API 2.3.227, Mapper 1.0.31-beta) on 2026-10-20 while preparing the OHDSI 2026 Mapper demo.

The Mapper's Context field (Configure) is stored in MapProject.description. MapProjectCreateUpdateSerializer accepts it, but no read serializer returns it:

  • core/map_projects/serializers.py: MapProjectSerializer.Meta.fields, and so MapProjectDetailSerializer, leave out description. MapProject.CONFIGURATION_FIELDS doesn't include it either.
  • oclmap loads it with setDescription(response.data?.description || '') (MapProject.jsx), so it always loads '', and every save sends description back (formData.append('description', description)).

Reproduced on a project:

  1. Enter Context and save. The map_projects row has the text.
  2. Reload the project. Context is blank.
  3. Save again for any reason. description is now '' in the database.

Every user who fills in Context loses it on the next save after a reload, with no warning.

Acceptance criteria

  • GET on a map project returns description.
  • After a reload the Mapper shows the saved Context, and saving keeps it.
  • Decide whether Create similar copies Context; if so, include it in configurations/.
  • A test covers the save, read and save-again round trip.
主要语言
没有语言数据
星标
4
派生
2
平均合并
2 小时 12 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenConceptLab/ocl_issues 的其他 Issue

查看 OpenConceptLab/ocl_issues 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。