Skip to content

Issue with client.v2.tweet Function Not Returning Response and Freezing Server #497

Description

@sampatsharma143

I'm encountering an issue with the client.v2.tweet function from the Twitter API library within supabase cloud functions. The problem is that when I use this function to post a tweet, it doesn't seem to return a response as expected, and it leads to the server becoming unresponsive or freezing. but it does post the tweet to my twitter account.

code

const client = userClient.readWrite;
try{
  const postTweet = await client.v2.tweet({text:tweetText});
  // console.log(postTweet )
  return new Response(
    JSON.stringify({
      message: postTweet,
    }),
    { headers: { "Content-Type": "application/json" }, status: 200, },
  );
}catch(e){
  const error = {
    message: e,
  };
  
  return new Response(
    JSON.stringify(error),
    { headers: { "Content-Type": "application/json" },status:300 },
  );
}

Please let me know if there are any suggestions or potential solutions to resolve this issue. Your assistance is greatly appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions