Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties not yet Loaded for a Files modifiedBy #1516

Closed
1 task done
priests123 opened this issue Aug 28, 2024 · 2 comments
Closed
1 task done

Properties not yet Loaded for a Files modifiedBy #1516

priests123 opened this issue Aug 28, 2024 · 2 comments
Assignees
Labels
area: model 📐 Related to the core SDK models question Further information is requested

Comments

@priests123
Copy link

Category

  • Bug

Describe the bug

When trying to query properties (Id, UserPrincipalName, AadObjectId) of the ModifiedBy of a File, it fails with the following error message:

Property [X] was not yet loaded - X being the name of a property

It is intermittent too. Sometimes it has the property value and other times it doesn't.

Steps to reproduce

Below is the code I'm using:

 var item = await list.Items.GetByIdAsync(itemId, i => i.Id,
    i => i.File,
    i => i.Versions,
    i => i.FileSystemObjectType);

 var file = await item.File.GetAsync(
    f => f.TimeLastModified,
    f => f.Name,
    f => f.CheckOutType,
    f => f.ModifiedBy.QueryProperties(u => u.Id, u => u.AadObjectId, u => u.Mail, u => u.UserPrincipalName));

var modifiedById = file.ModifiedBy.Id // <-- Fails on this line

Expected behavior

After getting the file, the properties on ModifiedBy should be available

Environment details (development & target environment)

  • SDK version: 1.12.0
  • SDK used in: Azure hosted Web Job
  • Framework: .NET v8
@jansenbe jansenbe self-assigned this Sep 17, 2024
@jansenbe jansenbe added question Further information is requested area: model 📐 Related to the core SDK models labels Sep 17, 2024
@jansenbe
Copy link
Contributor

@priests123 : I'm not able to reproduce this, in my testing I see the fields being populated. When your test fails, do you see a call similar to this _api/Web/lists(guid'35e90389-aead-4fad-8aa6-bf30ea65d198')/items(4)/file?$select=CheckOutType%2cName%2cTimeLastModified%2cUniqueId%2cModifiedBy%2fId%2cModifiedBy%2fAadObjectId%2cModifiedBy%2fEmail%2cModifiedBy%2fUserPrincipalName&$expand=ModifiedBy ?

@jansenbe
Copy link
Contributor

@priests123 : I'm closing this issue per no feedback. If the issue still is there for you then please check above comment and re-open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model 📐 Related to the core SDK models question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants