Sync update to a missing content node is marked applied

オープン
#6,412 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api, backend, testing

調査の方向性

Read BulkUpdateMixin.update_from_changes in contentcuration/contentcuration/viewsets/base.py around lines 880–894, then inspect its serializer and missing-key handling. Add regression tests for missing single and composite keys and for a failed bulk update with missing keys; done means all three cases mark changes errored and preserve the "Not found" and bulk update errors.

索引モデルが issue の本文から書いたものです。

説明

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

When a sync update change targets an object that doesn't exist, update_from_changes should mark the change "Not found". For models keyed by a single id, such as content nodes, the check never matches, so the change is marked applied with no error and the client believes the update was saved.

Complexity: Low
Target branch: hotfixes

Context
  • BulkUpdateMixin.update_from_changes tests tuple(change["key"]) in serializer.missing_keys. For a string key, tuple() produces a tuple of its characters, which never equals the string keys in missing_keys.
  • The same block assigns errors afresh when there are missing keys, discarding the "Internal server error" entries the except branch above it added.
  • Reproduced: a contentnode update change with mods: {"parent": ..., "kind": ...} for an id that doesn't exist is marked applied=True, errored=False.
The Change
  • An update change whose object doesn't exist should be marked errored with "Not found", for single and composite keys.
  • Errors from a failed bulk update should be kept alongside any "Not found" errors.
Acceptance Criteria
General
  • A contentnode update change for a nonexistent id is marked errored with "Not found".
  • An update change for a nonexistent composite key, such as an assessment item's, is still marked "Not found".
  • When the bulk update raises and some keys are missing, every change in the batch is marked errored.
Testing
  • Each criterion has a regression test.

AI usage

I scoped the audit. Claude Code found and reproduced this failure and drafted this issue.

主要言語
JavaScript
スター
214
フォーク
327
平均マージ
17時間 5分
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

learningequality/studio のほかの issue

learningequality/studio の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。