[HELP] Adaptive cards timeout after 40 seconds

After about 30 to 40 seconds adaptive cards seem to just time out any help would be nice here is my code

1 Like

Seems to me like it could be a bug. If you’re able to reproduce it on various artifact versions and different machines then I suggest filling out a bug report and make sure to use the template and provide enough detail and a repro for the devs to be able to fix it.

I believe I saw someone talk about something similar on DC but no repro was ever provided.

this happens not just in adaptive cards but normal deferrals.
to fix this you can use deferalls.update every x amount of intervals. idk if it will work or not but try :wink:

and use deferalls.done after message!

@Hriday08 Put the card in a loop every 10 seconds to send the card again just seems to cause the timeout when the card changes

@termanator1128 tried with the latest artifacts same issue also got a friend to connect and again the adaptive card timed out for him also tried with my localhost and a windows server on different network

I’d go ahead and submit a bug report then.

Hey! So players on my Server have the exact same issue. But they are already in the “downloading content”-stage. So when they are new on my server and they are ‘downloading content’ (which might take some time) they just time out at some point. But I don’t use a custom adaptive card before.
Is there any solution idea?

You are presenting the adaptive card and then you return, there is no call to deferrals.done(‘reason’) in this case and probably why it gets held up and timed out.

The other thing I notice is that you do not use a Citizen.CreateThread at any point, I’m not sure what’s going on in the rest of your -- rest isnt needed section of the code but you’re likely blocking the main thread with waits.

This seems to work good for me in lua:

AddEventHandler('playerConnecting', function(name, reason, deferrals)

    local _adaptiveCard = adaptiveCardDefault

    deferrals.defer()
    deferrals.presentCard(_adaptiveCard)

    local _source = source

    Citizen.CreateThread(function()
        -- rest of player connecting code here
        -- you can update the card contents by changing the _adaptiveCard table properties as needed
    end)
end