{"record":{"id":"48db6876d9c73bb1","repo":"stride3d/stride","slug":"this-operation-is-not-supported-by-the-source-tracker","errorCode":null,"errorMessage":"This operation is not supported by the source tracker.","messagePattern":"This operation is not supported by the source tracker\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Tracking/AssetSourceTracker.cs","lineNumber":435,"sourceCode":"                            {\n                                // Untrack assets that are currently tracked, but absent from the package session.\n                                if (!allAssetIds.Contains(asset.Key))\n                                    assetsToUntrack.Add(asset.Key);\n                            }\n                            foreach (var asset in assetsToUntrack)\n                            {\n                                UnTrackAsset(asset);\n                            }\n                            // Track assets that are present in the package session, but not currently in the list of tracked assets.\n                            allAssetIds.ExceptWith(trackedAssets.Keys);\n                            foreach (var asset in allAssetIds)\n                            {\n                                TrackAsset(asset);\n                            }\n                        }\n                        break;\n                    default:\n                        throw new NotSupportedException(\"This operation is not supported by the source tracker.\");\n                }\n            }\n        }\n    }\n\n    private void DirectoryWatcher_Modified(object? sender, FileEvent e)\n    {\n        // If tracking is not enabled, don't bother to track files on disk\n        if (!EnableTracking)\n            return;\n\n        // Store only the most recent events\n        lock (fileEvents)\n        {\n            fileEvents.Add(e);\n        }\n    }\n","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Tracking/AssetSourceTracker.cs#L417-L453","documentation":"When the tracked asset collection raises a change of an unexpected kind, AssetSourceTracker's Assets_CollectionChanged handler falls into the default branch and throws NotSupportedException. The tracker only supports the specific NotifyCollectionChanged Add/Remove/Replace/Reset actions it handles; anything else is a programming/incompatibility signal.","triggerScenarios":"Raising a custom NotifyCollectionChangedEventArgs with an unusual action on the asset collection; a new/foreign collection implementation feeding the tracker with actions outside its switch; version drift where a new NotifyCollectionChangedAction was added upstream.","commonSituations":"Custom asset collections in editor tooling; firing collection-changed events manually for testing; binding the tracker to a collection type it was not designed for.","solutions":["Only raise standard Add/Remove/Replace/Reset collection-changed events on the tracked collection","Update Stride so both the tracker and collection come from the same version","Inspect the event args action at the throw site and add explicit handling if you truly need a new action","Avoid manually raising NotifyCollectionChanged events; mutate the collection through its normal API"],"exampleFix":"// before\ncollection.OnEvent(new NotifyCollectionChangedEventArgs((NotifyCollectionChangedAction)99));\n// after\ncollection.Add(newAsset); // uses a supported action handled by the tracker","handlingStrategy":"try-catch","validationCode":"if (e.Action is not (NotifyCollectionChangedAction.Add or NotifyCollectionChangedAction.Remove or NotifyCollectionChangedAction.Replace or NotifyCollectionChangedAction.Reset))\n    return; // or log before mutating the tracked collection","typeGuard":null,"tryCatchPattern":"try { MutateAssets(collection); }\ncatch (NotSupportedException ex)\n{\n    Log.Warning(\"Unsupported collection change by the source tracker: {Message}\", ex.Message);\n}","preventionTips":["Only raise standard NotifyCollectionChanged actions","Mutate the asset collection through its normal API, never by firing raw events","Keep Stride libraries at consistent versions","Test custom collections against the tracker before wiring them into the editor"],"tags":["csharp","notsupportedexception","collections","asset-tracking"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}