Skip to content

Ensure Unique Temporary File Names and Guaranteed Clean-up #1044

Open
bhc-wp wants to merge 3 commits intopnp:devfrom
WorkPoint-A-S:dev
Open

Ensure Unique Temporary File Names and Guaranteed Clean-up #1044
bhc-wp wants to merge 3 commits intopnp:devfrom
WorkPoint-A-S:dev

Conversation

@bhc-wp
Copy link
Copy Markdown

@bhc-wp bhc-wp commented Jul 30, 2024

This pull request introduces improvements to address file handling issues encountered during site collection creation.

Key Changes

  1. Unique Temporary File Names:

    • Appended a unique identifier (GUID) to temporary file names to prevent collisions.
  2. Ensured File Deletion:

    • Encapsulated resource file operations within a try-finally block to guarantee that temporary files are deleted after processing.

Details

The changes are implemented in the SaveResourceValues method in src/lib/PnP.Framework/Provisioning/ObjectHandlers/Extensions/UserResourceExtensions.cs.

Stack Trace Example:
Here's an example stack trace that demonstrates the issue:

System.Resources.ResourceReader.ReadResources
System.Resources.ResourceReader..ctor
PnP.Framework.Provisioning.ObjectHandlers.Extensions.UserResourceExtensions.SaveResourceValues
PnP.Framework.Provisioning.ObjectHandlers.ObjectLocalization.ExtractObjects
PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.GetRemoteTemplate
Microsoft.SharePoint.Client.WebExtensions.GetProvisioningTemplate
WorkPoint.Core.ProvisioningProvider.ExportSiteCollection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants