Source and collection detail: updatedSince filters the repository itself, so the request returns 404

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
api

调研方向

Read get_base_queryset in core/common/models.py, then trace how source and collection detail views use it and how updatedSince filters included concepts and mappings. Check the serializers in core/common/serializers.py and the detail documentation in oclapi/apireference/sources.md and collections.md for the verbose decision. Add a test where updatedSince is later than the repository's updated_at; confirm detail requests filter included rows and repository lists still filter repositories.

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

描述

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

Summary

On a source or collection detail, updatedSince filters the repository itself as well as the included concepts and mappings. Editing concepts or mappings doesn't change the repository's own updated_at, so the request returns 404 whenever updatedSince is later than the last change to the repository's details:

  • GET /orgs/CIEL/sources/CIEL/?includeConcepts=true&limit=2&updatedSince=2026-09-01 → 200 (CIEL's updated_on is 2026-09-04)
  • the same with updatedSince=2026-09-24T03:03:36Z → 404
  • GET /orgs/CIEL/collections/MPX/?updatedSince=2026-10-20 → 404 (its updated_on is 2026-02-25); with 2026-01-01 → 200

Reproduced on staging with a new source: right after editing its concepts, the detail request with updatedSince set to the release time returned 404, while concepts/?updatedSince=… returned the edits.

Cause: get_base_queryset applies updated_at__gte to the repository queryset (core/common/models.py#L881). That's right for repository lists, but the detail views use it too.

Also: the included concepts and mappings are always brief rows (core/common/serializers.py#L339, since OpenConceptLab/ocl_issues#1528): no names, descriptions or extras, even with verbose=true or Compress: true. A client can't import concepts from them.

Impact: the OpenMRS OCL module's snapshot (HEAD) subscription uses this request (OclClient.fetchSnapshotUpdates, with updatedSince), so those subscriptions fail once their last import is newer than the repository's details. oclapi/apireference/sources.md and collections.md document updatedSince on the detail as filtering the included concepts and mappings only.

Acceptance criteria

  • On a source or collection detail (HEAD or a version), updatedSince filters only the included concepts and mappings. Repository lists still filter repositories.
  • Decide whether the included concepts and mappings honor verbose=true; if not, sources.md and collections.md say they're brief.
  • A test covers a detail request whose updatedSince is later than the repository's updated_at.
主要语言
没有语言数据
星标
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 摘要。