{"record":{"id":"ebeb4aa6f3e2a0ea","repo":"EllanJiang/GameFramework","slug":"there-is-already-a-resource-group-0-being-updated","errorCode":null,"errorMessage":"There is already a resource group '{0}' being updated.","messagePattern":"There is already a resource group '(.+?)' being updated\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.ResourceUpdater.cs","lineNumber":330,"sourceCode":"            /// <summary>\n            /// 应用指定资源包的资源。\n            /// </summary>\n            /// <param name=\"resourcePackPath\">要应用的资源包路径。</param>\n            public void ApplyResources(string resourcePackPath)\n            {\n                if (!m_CheckResourcesComplete)\n                {\n                    throw new GameFrameworkException(\"You must check resources complete first.\");\n                }\n\n                if (m_ApplyingResourcePackStream != null)\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"There is already a resource pack '{0}' being applied.\", m_ApplyingResourcePackPath));\n                }\n\n                if (m_UpdatingResourceGroup != null)\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"There is already a resource group '{0}' being updated.\", m_UpdatingResourceGroup.Name));\n                }\n\n                if (m_UpdateWaitingInfoWhilePlaying.Count > 0)\n                {\n                    throw new GameFrameworkException(\"There are already some resources being updated while playing.\");\n                }\n\n                try\n                {\n                    long length = 0L;\n                    ResourcePackVersionList versionList = default(ResourcePackVersionList);\n                    using (FileStream fileStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read))\n                    {\n                        length = fileStream.Length;\n                        versionList = m_ResourceManager.m_ResourcePackVersionListSerializer.Deserialize(fileStream);\n                    }\n\n                    if (!versionList.IsValid)","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceUpdater.cs#L312-L348","documentation":"ApplyResources throws this (with the group name interpolated) when a resource group update is currently in progress (m_UpdatingResourceGroup non-null). Applying a resource pack while a group is being updated from remote sources would conflict, so the manager rejects it.","triggerScenarios":"Calling ApplyResources while UpdateGroup/UpdateResources is actively downloading a resource group; initiating a pack application from the same flow that also triggers group updates.","commonSituations":"Automatic update logic that kicks off both a version-update download and a local resource-pack apply; user pressing 'update' and 'apply pack' near-simultaneously; retry timers colliding with an ongoing update.","solutions":["Cancel or wait for the running resource group update (completion/failure callback) before calling ApplyResources","Sequence your flow: finish UpdateGroup first, then apply resource packs, or vice versa","Track update state in your game code and refuse pack application while an update is active"],"exampleFix":"// before\nresourceManager.UpdateGroup(\"ui\", null);\nresourceManager.ApplyResources(packPath); // group update still running\n// after\nvoid OnGroupUpdateComplete(...) { resourceManager.ApplyResources(packPath); }\nresourceManager.UpdateGroup(\"ui\", OnGroupUpdateComplete);","handlingStrategy":"try-catch","validationCode":"// track group update state yourself\nif (m_GroupUpdating) return; // wait for completion first","typeGuard":null,"tryCatchPattern":"try { resourceManager.ApplyResources(packPath); } catch (GameFrameworkException ex) { Log.Warn(\"Resource group update in progress: \" + ex.Message); }","preventionTips":["Sequence group updates and pack applications; never run them concurrently","Subscribe to resource update start/success/failure events to track state","Cancel active updates before initiating pack application"],"tags":["csharp","gameframework","concurrency","invalid-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}