Preserve metadata for unknown activities#7323
Conversation
Greptile SummaryThis PR correctly preserves metadata for unknown activities during deserialization. The implementation addresses the issue raised in elsa-studio-765 where workflow designer metadata (layout, annotations) was lost when an activity type couldn't be resolved. Key changes:
The developer's responses to previous thread comments demonstrate understanding of the code flow. The metadata extraction reads from the correct source ( Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/modules/Elsa.Workflows.Core/Serialization/Converters/ActivityJsonConverter.cs | Adds metadata preservation when deserializing unknown activities - implementation is correct and addresses the previous thread concerns |
Last reviewed commit: daa0f57
src/modules/Elsa.Workflows.Core/Serialization/Converters/ActivityJsonConverter.cs
Outdated
Show resolved
Hide resolved
src/modules/Elsa.Workflows.Core/Serialization/Converters/ActivityJsonConverter.cs
Outdated
Show resolved
Hide resolved
src/modules/Elsa.Workflows.Core/Serialization/Converters/ActivityJsonConverter.cs
Outdated
Show resolved
Hide resolved
…from NotFoundActivity wrapper.
… metadata extraction in `ActivityJsonConverter`.
|
@greptile please do another round of review. |
There was a problem hiding this comment.
Pull request overview
This PR addresses the loss of designer/UI metadata when deserializing activities whose types cannot be resolved. Previously, when an unknown activity was converted to a NotFoundActivity placeholder, its metadata (containing layout coordinates, annotations, etc.) was lost, causing issues with workflow designer round-tripping.
Changes:
- Extract and preserve metadata from unknown activities during deserialization
- Assign metadata to NotFoundActivity before setting display text/description to ensure proper ordering
- Add explanatory comments documenting the metadata preservation logic
src/modules/Elsa.Workflows.Core/Serialization/Converters/ActivityJsonConverter.cs
Outdated
Show resolved
Hide resolved
…ityJsonConverter.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Why
How
How to Test
Breaking Changes
Review Focus
Relates to elsa-studio-765