Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debounce for dynamic properties's "refreshers" input fields - Be nice to rate limiting APIs #3142

Closed
Gunther-Schulz opened this issue Nov 8, 2023 · 2 comments
Labels
🛠️ piece-framework Changes Related to Piece framework

Comments

@Gunther-Schulz
Copy link
Contributor

Gunther-Schulz commented Nov 8, 2023

When using dynamic properties with a "refreshers" property set to an input field, a call to the external API of a service is always immediately made when the contents of the input field change (think entering an e-mail address). This creates a lot of unnecessary calls to the API. This is a problem for rate-limiting APIs and server load.

A delay time, so-called debounce, could be set before the dynamic property makes a request to the external API. This could be another attribute of a dynamic property or an attribute of an input field taking the delay time. For example, setting a delay time of 3000ms would wait 3 seconds after someone stopped typing their email address into an input field before the code in the dynamic property is run. An implementation could be done using the lodash debounce library as it is already a dependency of activepieces.

I have tried implementing debounce on the piece level using lodash debounce and my own implementation, but I was unsuccessful because the state of the initialized debounce object is cleared with every keystroke in the input field. It seems this has to be implemented via the activepieces framework itself.

@abuaboud
Copy link
Contributor

I think this is now fixed with the recent refactoring.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If this issue is continuing with the latest stable version of Activepieces, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ piece-framework Changes Related to Piece framework
Projects
None yet
Development

No branches or pull requests

2 participants