poohcom1 / twitter-art-collection

A web app to organize your twitter art likes! But website now down because Twitter API expensive :(
1 stars 1 forks source link

[BUG] Webpage would occasionally crash due to undefined variable #12

Open poohcom1 opened 2 years ago

poohcom1 commented 2 years ago

Issue

When switching tags, webpage would sometime crash due to a client-side exception.

Solution

https://github.com/poohcom1/twitter-art-collection/blob/1f30e34a96ec1e5f0eef30764a4a7c64017f3880/src/stores/ImageList.ts#L91 Occasionally, tweet in tweet.id would be undefined. We should investigate what is the root cause of this.

poohcom1 commented 2 years ago

Update: Added a hotfix to filter out undefined tweets.

However, the main issue is still why some tweets are undefined. The main api that retreives the tweet is the /user api: https://github.com/poohcom1/twitter-art-collection/blob/8be8f5d371065fab5a5edeb1ffb8afca48feacd1/pages/api/user.ts#L12

This function may be the culprit