Bug: Token Regex for fileuniqueid* matches too broadly
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
This Regex matches more than just fileuniqueid* tokens:

This will be handled OK since exceptions are swallowed, but calls are made that are not necessary (for every field content containing curly braces). So this Regex could be improved to not trigger those redundant calls.
Alternative easy improvement: after this line:
https://github.com/pnp/pnpframework/blob/83eaf1f88370b8fd35245a3ce2a01272178f4869/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs#L308
Add:
if (tokenParts.Length < 2)
{
continue;
}
This catches most mismatches and prevents further redundant calls.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs around lines 283 and 308, and inspect how the token regex and tokenParts handling process field content containing curly braces. Confirm the change limits processing to fileuniqueid* tokens and prevents redundant calls for mismatches; done means unrelated curly-brace content no longer reaches the lookup path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100