API Queue Read not working

So I am trying to achieve a global party invite system using MemoryStoreService. To do this, I am calling the :ReadAsync() in a pcall in a while true loop so that the user can get the message instantly from when the invite is sent. However, the issue is that sometimes, I get this error, resulting in delays of around 20 seconds. Anyone have any solutions?

If you need me to be more descriptive, please let me know. Thank you!

Internal Errors on the documentation appear to be because Roblox is down, or because it’s a bug that you need to report.

From my experience, calling any function with “Async” (:GetAsync(), :ReadAsync(), etc.) too many times in a short period causes errors, so you could try adding a delay. If it continues to not work, I recommend reporting the bug

You can use MessagingService for this instead

Hey there! Thanks for sharing the details—I can see why this delay is frustrating. Using MemoryStoreService for a global party invite system is a solid idea, but the Internal Error: API: Queue.Read, Data Structure: partyInvites error suggests you might be hitting rate limits or internal issues with MemoryStoreService.

Since you’re polling with a while true loop and ReadAsync, the frequent calls might be overwhelming the service, especially if many players are doing this at once. MemoryStoreService has strict rate limits (e.g., ~100 reads per minute per queue globally), and exceeding them can trigger these errors, leading to the 20-second delays you’re seeing.

Here’s a quick suggestion: instead of polling with a tight loop, you could use a longer delay between ReadAsync calls (like wait(5)) to stay under the rate limit. Better yet, consider using a pub-sub pattern with MessagingService to notify players of invites instantly, then use MemoryStoreService only to fetch the invite data when a message is received. This would reduce the load on MemoryStoreService significantly.

Here’s a rough example of how you might combine the two:

local MemoryStoreService = game:GetService("MemoryStoreService")
local MessagingService = game:GetService("MessagingService")
local Players = game:GetService("Players")

local INVITE_QUEUE = MemoryStoreService:GetQueue("partyInvites")

-- On invite send (server)
local function sendInvite(senderId, receiverId, partyData)
    INVITE_QUEUE:AddAsync({sender = senderId, party = partyData}, 3600, receiverId)
    MessagingService:PublishAsync("PartyInvite_" .. receiverId, {senderId = senderId})
end

-- On client/server receiving invite
MessagingService:SubscribeAsync("PartyInvite_" .. Players.LocalPlayer.UserId, function(message)
    local senderId = message.Data.senderId
    local success, inviteData = pcall(INVITE_QUEUE.ReadAsync, INVITE_QUEUE, senderId, 1, false, 10)
    if success and inviteData then
        print("Received invite from", senderId, ":", inviteData)
        -- Show invite UI to player
    end
end)

This way, MessagingService handles the instant notification, and MemoryStoreService is only queried when needed, avoiding the polling loop entirely. It should help with the delays and errors.

If you’re still seeing issues, could you share more about your loop setup (e.g., how often it polls) or the number of players involved? That’d help narrow it down further. Hope this helps!

Sorry for the late response, but I see what you are doing here.
However, my main issue is that what if MessengingService fails? Though, I think I may have a solution on how to fix this issue by running the while true loop every second (so it doesn’t overload the memory access thing) and using MessengingService parallel to this loop.

I would need to use it parallel to MemoryStoreService since it can fail sometimes from what I heard, but it could help reduce the number of calls to the server’s memory since I would only need to do pcall every second or so instead of constantly calling it.