Files
plane/apps/api
Sriram Veeraghanta 2be57e2467 fix(api): expand null relations to null instead of an empty object
`?expand=updated_by` was reported in #4639 as returning a bare UUID
because `updated_by` was missing from the expansion mapper. #7667 added
the key, but that alone did not fix the reported request: `BaseModel.save`
leaves `updated_by` NULL until a record is first updated, and expanding a
null relation called `UserLiteSerializer(None)`, which DRF resolves via
`get_initial()` to `{}`. The app layer never got the key at all, and its
null case produced a ghost user with blank names.

Resolve the relation off the instance instead of guessing arity from the
already-serialized value, and keep a null relation null so the expanded
and unexpanded responses agree. Add `updated_by` to the app mapper, and
hoist its two duplicated copies into one `get_expansion_mapper()` -- the
duplication is why the original fix reached only one of them.

`issue_attachment` is deliberately left out of the unified mapper: it is
the reverse manager of the legacy `IssueAttachment` model, which
`IssueAttachmentLiteSerializer` (`model = FileAsset`) cannot serialize.

Also document the supported `expand` values, which were previously
undiscoverable, and add the first test coverage for `expand`.

Claude-Session: https://claude.ai/code/session_0142ihfx57JhqVnvs5w73aX7
2026-08-30 19:06:18 +05:30
..
2025-12-05 16:03:51 +05:30
2026-01-27 13:54:22 +05:30
2026-08-16 23:36:30 +05:30
2025-07-04 15:32:21 +05:30
2026-01-27 13:54:22 +05:30