AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
620 stars 227 forks source link

uid inside the List can't be convert to uint32_t #755

Closed anisurrahman072 closed 8 months ago

anisurrahman072 commented 8 months ago

Describe the bug A working code broke after almost one year. Fifteen to twenty days ago, the error ‘uid inside the List can’t be converted to uint32_t’ started appearing from the AGORA server when calling the REST API below 👇.

- REST API: https://api.agora.io/v1/apps/${AGORA_APP_ID}/cloud_recording/resourceid/${resourceId}/mode/individual/start

To Reproduce Steps to reproduce the behavior. Call the above API from React native app using a fetch() to start Cloud Recording in Individual Mode. Below is the full request body that has been given.

await fetch(
        `https://api.agora.io/v1/apps/${AGORA_APP_ID}/cloud_recording/resourceid/${resourceId}/mode/individual/start`,
        {
            headers: {
                Accept: 'application/json',
                'Content-type': 'application/json',
                Authorization: getAgoraAuthorization()
            },
            method: 'post',
            body: JSON.stringify({
                cname: 'db_document_id',
                uid: '69341295',
                clientRequest: {
                    recordingConfig: {
                        channelType: 1,
                        streamTypes: 2,
                        maxIdleTime: 30,
                        subscribeVideoUids: [hostAgoraUid],
                        subscribeAudioUids: [hostAgoraUid],
                        subscribeUidGroup: 0
                    },
                    snapshotConfig: {
                        captureInterval: 10,
                        fileType: ['jpg']
                    },
                    storageConfig: {
                        vendor: 1,
                        region: 0,
                        bucket: AWS_S3_BUCKET_NAME,
                        accessKey: AWS_ROOT_USER_ACCESS_KEY,
                        secretKey: AWS_ROOT_USER_SECRET_KEY,
                        fileNamePrefix: [
                            AWS_STREAM_RECORDS_FOLDER_NAME,
                            userId,
                            folderCommonPrefix,
                            AWS_STREAM_SNAPSHOTS_FOLDER_NAME
                        ]
                    }
                }
            })
        }
    ).then((response) => response.json())

Expected behavior I should get a valid response like { sid: "sid_came_from_agora_server", resourceId: "resource_id_came_from_agora_server" }

Screenshots Instead I'm getting like below response (ERROR) 👇

Screenshot 2023-12-18 at 11 10 50 AM

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context The code was working smoothly for the last year & we are a paid user of AGORA. However, the streaming recording got vulnerable 15-20 days ago and started returning an error message like the one above. We initially thought that the ‘uid’ was causing the issue, but we tried many variations of ‘uid’ in the request body. An example is given below:

As from doc I saw that, uid must be STRING so used these below 👇

Nothing worked!

As we are a PAID user of AGORA for last 1 year, please keep it in high priority @LichKing-2234

guoxianzhe commented 8 months ago

@anisurrahman072 I think this is REST API issue, please open a technical support ticket and send the url here. We will contact the relevant technology as soon as possible to follow up on this issue.

anisurrahman072 commented 8 months ago

Thanks for reaching out. Yea, already created a Ticket with tag "Integration ISSUE" ✅

Ticket URL: https://agora-ticket.agora.io/issue/fb39bb24478d41e2915b3d2047d8d7fd

Please let me know if you need to know more.

guoxianzhe commented 8 months ago

@anisurrahman072 Thank you, I already contact with tech team and they will contact you from ticket soon.

anisurrahman072 commented 8 months ago

@guoxianzhe, could you please connect the TICKET with a REACT NATIVE guy, as me & Alex (from AGORA) found that the issue mainly raised from inside AGORA listener. The listener was OK in last month but not sure what happened about it now.

FYI, the listener code is below

_engine.current.addListener('JoinChannelSuccess', async (uid) => 
{
    // Only called when this current USER successfully joined in the channel

    console.log('THE HOST UID came from AGORA: ', uid) // The uid returned this "657fca6fb065aad8ba82808f". But it should return like this "2681811856" --> A number in string format.

    setHostAgoraUid(String(uid))
})

it would be better if you connect the ticket with a REACT NATIVE guy.

guoxianzhe commented 8 months ago

@anisurrahman072 Have you upgrade react-native-agora recently? If not, can you please tell me what version are you using now?

anisurrahman072 commented 8 months ago

Not yet upgraded. We are still in SDK version "^3.7.0". As the upgrade process needs some time so made it delay. We used it in more than 30+ screens. Thought to upgrade it when we will feel OK with our feature development.

guoxianzhe commented 8 months ago

@anisurrahman072 that is weird, If you didn't upgrade SDK version you should got the same callback result. Maybe The changed part is REST API I think.

anisurrahman072 commented 8 months ago

Finally solved it. Alex told me to update the listener callback parameters to (channel, uid, ellapsed). That solved it.

So, the code I wrote is almost 1 year old here & also github proves it too. Since then, the code was fully working & our customers streamed & recorded tons of VIDEOS by cloud recording API. Just from this month it went wrong.

After Alex told me, I just updated into 3 parameters & solved it 🔥. Nothing I changed. Only that 3 parameter I added & solved it.

Thanks you guys. We will move to v4.0 for sure soon.