HKUDS/DeepTutor · error · LearningConflictError

LearningConflictError(path_id, int(progress.version), 0)

Error message

LearningConflictError(path_id, int(progress.version), 0)

What it means

Error "LearningConflictError(path_id, int(progress.version), 0)" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/learning/storage.py:472

            row = conn.execute(
                "SELECT * FROM mastery_paths WHERE path_id = ?", (path_id,)
            ).fetchone()
        return self._progress_from_row(row) if row is not None else None

    def save(self, progress: LearningProgress) -> None:
        path_id = self._validate_id(progress.book_id)
        self._import_legacy_if_needed(path_id)
        now = time.time()
        with self._connect() as conn:
            conn.execute("BEGIN IMMEDIATE")
            try:
                row = conn.execute(
                    "SELECT revision, created_at FROM mastery_paths WHERE path_id = ?",
                    (path_id,),
                ).fetchone()
                if row is None:
                    if int(progress.version) != 0:
                        raise LearningConflictError(path_id, int(progress.version), 0)
                    revision = 1
                    conn.execute(
                        """
                        INSERT INTO mastery_paths (
                            path_id, state_json, revision, created_at, updated_at
                        ) VALUES (?, ?, ?, ?, ?)
                        """,
                        (
                            path_id,
                            self._progress_payload(progress, revision, now),
                            revision,
                            progress.created_at,
                            now,
                        ),
                    )
                    event_type = "path.created"
                else:
                    actual = int(row["revision"])

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/learning/storage.py:472 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/73365401a124cc46. Report an issue: GitHub.