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

Multiple events per transaction #76

Open
RohovDmytro opened this issue May 18, 2024 · 1 comment
Open

Multiple events per transaction #76

RohovDmytro opened this issue May 18, 2024 · 1 comment
Assignees

Comments

@RohovDmytro
Copy link

RohovDmytro commented May 18, 2024

Hi! I'm seeing multiple runs of a Google Cloud Function created by RevenueCat Extension.

  1. RevenueCat Integration creates a Google Cloud function
  2. Min instances for it is 0
  3. When RevenueCat posts an event it make GCP Function start from cold
  4. The start takes too long so someone (RevenueCat?) detects a timeout
  5. RevenueCat sends a second request (to already pre-warmed function from the first call)
  6. The first request actually was not cancelled, just delayed.
  7. THe event from the first request start being processed
  8. The event from the second requests start being processed

Thus I have a situation when a single RevenueCat event dispatches two events both of which got handled.

Can we make RevenueCat wait for the cold start longer? Can we set a min instances for a Google Cloud Function through extension settings?

@vicfergar
Copy link
Contributor

vicfergar commented Jun 8, 2024

Hi @RohovDmytro,

Thanks for the detailed explanation.

It sounds like the issue you’re describing is related to cold starts and duplicate processing of events. However, I would like to understand why this is an issue for you. The extension function should handle this by using unique identifiers (UUIDs) for each event, preventing duplicates when storing events and customers in Firestore Collections.

Regarding the min-instances parameter, you are correct that we haven’t included that parameter in the extension definition yet. However, we can add it if needed. Please note that setting min-instances to a value greater than 0 will result in a monthly fee for the function, as it will keep instances warm even when not in use. For details, see the Pricing page.

If you’re still experiencing problems with duplicate events, could you provide more details on how this is affecting you? This will help us better understand and address the issue.

@vicfergar vicfergar self-assigned this Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants