{"record":{"id":"f8dbc9ae19dc79c8","repo":"FyroxEngine/Fyrox","slug":"tile-set-update-page-missing","errorCode":null,"errorMessage":"Tile set update page missing.","messagePattern":"Tile set update page missing\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-impl/src/scene/tilemap/tileset.rs","lineNumber":1627,"sourceCode":"    /// Update the tile set using data stored in the given `TileSetUpdate`\n    /// and modify the `TileSetUpdate` to become the reverse of the changes by storing\n    /// the data that was removed from this TileSet.\n    ///\n    /// [`rebuild_transform_sets`](Self::rebuild_transform_sets) is automatically called if a transform set page is\n    /// modified.\n    /// [`rebuild_animations`](Self::rebuild_animations) is automatically called if an animation page is\n    /// modified.\n    ///\n    /// Wherever there is incompatibility between the tile set and the given update,\n    /// the tile set should gracefully ignore that part of the update, log the error,\n    /// and set the update to [`TileDataUpdate::DoNothing`], because that is the correct\n    /// reversal of nothing being done.\n    pub fn swap(&mut self, update: &mut TileSetUpdate) {\n        let mut transform_changes = false;\n        let mut animation_changes: bool = false;\n        for (handle, tile_update) in update.iter_mut() {\n            let Some(page) = self.pages.get_mut(&handle.page()) else {\n                Log::err(\"Tile set update page missing.\");\n                continue;\n            };\n            if page.is_transform_set() {\n                transform_changes = true;\n            }\n            if page.is_animation() {\n                animation_changes = true;\n            }\n            page.swap_tile(handle.tile(), tile_update);\n        }\n        if transform_changes {\n            self.rebuild_transform_sets();\n        }\n        if animation_changes {\n            self.rebuild_animations();\n        }\n    }\n    /// Get the page at the given position.","sourceCodeStart":1609,"sourceCodeEnd":1645,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-impl/src/scene/tilemap/tileset.rs#L1609-L1645","documentation":"TileSet::swap applies a TileSetUpdate by iterating (handle, update) pairs; when the update references a page handle not present in the tile set, the library logs 'Tile set update page missing.' and skips that update entry. The update and tile set are then out of sync for those entries.","triggerScenarios":"Calling TileSet::swap with a TileSetUpdate containing TileSetUpdatePage handles whose page does not exist in the tile set (page removed before swap, or wrong handle keys).","commonSituations":"Editor code caching update handles across a page deletion; undo/redo stacks replaying updates against a modified tile set; concurrent edits removing pages between building the update and calling swap.","solutions":["Validate that every handle.page() in the TileSetUpdate exists in tile_set.pages before calling swap.","Rebuild the TileSetUpdate after any page insertion/removal so handles stay in sync.","If a page may have been removed, create it in the tile set before swapping.","Treat the logged skip as a signal: recompute the update rather than reusing stale ones."],"exampleFix":"// before\ntile_set.swap(&mut update); // may reference removed pages\n// after\nupdate.retain(|handle, _| tile_set.pages.contains_key(&handle.page()));\ntile_set.swap(&mut update);","handlingStrategy":"validation","validationCode":"for handle in update.handles() {\n    assert!(tile_set.pages.contains_key(&handle.page()), \"update references missing page {:?}\", handle.page());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invalidate cached TileSetUpdate handles when pages change.","Rebuild updates right before calling swap; never persist them across edits.","Guard undo/redo replay against the current tile set state."],"tags":["fyrox","tilemap","tileset","stale-handle"],"backgroundTag":"entity-not-found","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}