Skip to content

Hot reload does not re-register ORM field metadata (new field silently missing from to_dict()) #102

Description

@andrevanzuydam

CLI 3.8.58, tina4-python 3.13.87.

Repro

  1. tina4 serve a project with an ORM model.
  2. Add a field to the model while the server runs, e.g. completed = BooleanField(default=False).
  3. Add the matching column via a migration and tina4 migrate.
  4. POST/GET the resource.

Actual

The watcher logs the reload:

Reloaded changed module: src.orm.Todo

The column IS written to the database correctly (verified in SQLite: value 0), but to_dict() silently omits completed from every JSON response. No error, no warning.

A full server restart fixes it immediately.

Why it matters

Silent field-dropping is a bad failure mode: the data is correct on disk, the API just lies about it. A developer adding a field mid-session sees their new field "not saving" and will go hunting in the wrong place (ORM, migration, DB) because nothing errors.

Looks like reload re-imports the module but does not rebuild whatever field registry to_dict() serialises from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions