diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ee31f..6b9485d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 7.0.1 + +- Fix published layouts failing with "Node with id not found" on web + release builds. When the layout was replaced by a freshly decoded copy + with the same `lastUpdated`, the canvas was built from that copy, whose + nodes have no parent links. The canvas is now read from the resolved + node registry. + ## 7.0.0 ### Breaking changes diff --git a/lib/src/ui/layout_builder.dart b/lib/src/ui/layout_builder.dart index fe4da44..ffa6ee6 100644 --- a/lib/src/ui/layout_builder.dart +++ b/lib/src/ui/layout_builder.dart @@ -130,7 +130,15 @@ class _CodelesslyLayoutBuilderState extends State { ), ); + /// The canvas node from [nodeRegistry], whose parent links [loadLayout] + /// resolved. + /// + /// [widget.layout] can be replaced by a freshly decoded copy with the same + /// [SDKPublishLayout.lastUpdated], which [didUpdateWidget] does not reload. + /// Its nodes have no parent links, so building from it would look up a + /// parent with an empty ID. CanvasNode get canvasNode => + nodeRegistry.getNodeByIdOrNull(widget.canvasId) as CanvasNode? ?? widget.layout.canvases[widget.canvasId]![widget.canvasId] as CanvasNode; /// Whether the layout should be loaded. This is used to prevent the layout diff --git a/pubspec.yaml b/pubspec.yaml index 7156fd0..e7c836c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: codelessly_sdk description: Codelessly CloudUIâ„¢ - Server-driven UI for Flutter. Supercharge your Flutter apps with dynamic UI and real-time updates. Build and publish UI without code! -version: 7.0.0 +version: 7.0.1 homepage: https://codelessly.com/ repository: https://github.com/Codelessly/CodelesslySDK issue_tracker: https://github.com/Codelessly/CodelesslySDK/issues