learningequality / learningequality/morango

Serialization into store does not update _self_ref_fk for existing records

Open
#305 0 comments 0 reactions 1 assignee View on GitHub

@bjester is already working on this.

Since Jun 26, 2026.

DEV: backend P0 - critical
Dominant language
Python
Stars
15
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Target branch: release-0.9.x

Observed behavior

When the serialization process serializes app models into the store, it either creates new Store records or updates existing Store records for those models. When it creates new Store records, it properly sets _self_ref_fk which should store the value of a self-referential foreign key field that exists on the model. When the Store record already exists for the app model, it does not update _self_ref_fk, meaning if the app model's self-referential FK's value changed, the Store would not reflect that.

Expected behavior

The StoreUpdate streaming transform class should properly update _self_ref_fk regardless of whether the Store record is being created or updated.

Tests should be written/updated to ensure that this happens.

User-facing consequences

The primary consumer of Morango, Kolibri, does have models with self-referential FKs, but there isn't a use case where these would be updated. Although, this would cause an issue in the future if it did.

AI usage

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.