Filter projects by name

I have an app that fetches all Jira users and Jira projects and uses them like an option in a Select box.

The problem I am having is that if a user has hundreds of users and hundreds of projects, when trying to fetch them all I will get Platform unexpected error, which means " an app invocation has hit the runtime memory limit or time limit ."

What would be the best way to handle this situation?

I was thinking of implementing async Select box, and then just fetching projects containing the word from the select box. Would this solution work or I will have the same problem with invocation limits?

Is there a better solution?

Thank you.