Calling AvatarEditorService:PromptAllowInventoryReadAccess() without waiting a bit in studio does not work

Reproduction Steps
Calling AvatarEditorService:PromptAllowInventoryReadAccess() without any wait causes Studio to not show any prompt, when if you wait a bit it does.

  1. Create a new place
  2. Put in a local script under “StarterPlayerScripts”
  3. Put the following content in the script
local AvatarEditorService = game:GetService("AvatarEditorService")
AvatarEditorService:PromptAllowInventoryReadAccess()
  1. Expected result: A prompt to show up as expected.
  2. Actual result: Nothing happens

The likely cause is that the initialization script is deferred a bit, so the prompt never shows up. Please fix this race condition! Thank you!

image
This prompt doesn’t show up unless you delay the prompt API call a bit

Workaround

Current workaround is to insert a task.wait(1) at the beginning of the script.

Issue Area: Studio
Issue Type: Other
Impact: Low
Frequency: Constantly
Date First Experienced: 2022-11-05 00:11:00 (-07:00)

3 Likes

This behavior happens because the CoreScripts have not yet registered this callback and you need to wait for them to register. However, shouldn’t it give an error? That should be a feature request.

It should just work, an error would be acceptable. I don’t really care what the error is. :stuck_out_tongue:

1 Like

Thanks for the report! We’ll investigate.

2 Likes

I have submitted a fix for this issue.

2 Likes

Are there any updates on this? I don’t see anything in the output and calling this method does not work without yielding in the script’s main thread.

Should have specified in my previous post: The fix will hopefully release Wednesday 7th December.

2 Likes