Potential error in the Unity documentation for Collections

Hello,

Just wanted to report an error on the Collections page in the documentation.

For Unity/.NET this is the example given for reading a Storage object:

var result = await client.ReadStorageObjectsAsync(session, new StorageObjectId {
    Collection = "saves",
    Key = "savegame",
    UserId = session.UserId
});

Console.WriteLine("Read objects: [{0}]", string.Join(",\n  ", result.Objects));

But the latest version of the SDK doesn’t have a constructor for ReadStorageObjectsAsync which takes a single IApiReadStorageObjectId.

So it’s either an error in the documentation, or an oversight in the actual SDK. I believe there should be an option in the SDK to READ just one object instead of having to create an IEnumerable of IApiReadStorageObjectId with a single object every time you only want to read one.

This is actually the case for DeleteStorageObjectsAsync and WriteStorageObjectsAsync as well!

Regards,
Alex

1 Like

Thanks for reporting the issue @Antviss. I can confirm that the documentation is indeed incorrect and those functions do take an array. We will get this fixed in our documentation ASAP.

Just ran into the same issue, any ETA on when the documentation will get fixed? Also wondering how up to date is the current documentation overall?

@gabriel please double check and fix this if needed :pray:

@Fauman Just to clarify, our documentation is kept up to date with each new release of our products and is regularly updated with additional guides and content outside of those release cadences.

You can see our Release Notes page here to see the latest changes to Nakama documented Heroic Labs Documentation | Release Notes.

We apologise for the inconvenience here and will get this particular issue resolved immediately.

Thank you for quick response, and I am glad to hear that documentation is up to date, as I just started my journey with Nakama. Cheers!

@Fauman No problem, I have just checked our documentation and can confirm that this particular issue was resolved at the time (June 9th 2022 specifically).

Please can you confirm the actual documentation issue you are having?

@tom Well, I don’t know what to tell you, but its still there, even after I refreshed the page.


And If I literally copy-paste this code, my IDE, will give me the same error as was described in the topic.

@tom Oh I get it now, it was fixed there Heroic Labs Documentation | Collections, but not in the Unity guide, my apologies.

Ahh I understand. Thank you for pointing that out, I have updated the documentation and you should see the changes reflect on the live docs site in the next few hours.

In the meantime, you can replace this line:

var result = await client.ReadStorageObjectsAsync(session, readObjectId);

With this:

var result = await client.ReadStorageObjectsAsync(session, new [] { readObjectId });

1 Like

Much appreciated, and thanks for your help.