Skip to content

Conversation

@khvn26
Copy link
Member

@khvn26 khvn26 commented May 16, 2025

Closes #142.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the Analytics update is blocking the main execution flow. The key changes include converting the async GetFlag method to a synchronous returning Task wrapper and updating the analytics tracking call to execute without awaiting.

@khvn26 khvn26 requested a review from Copilot May 16, 2025 16:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the implementation of the GetFlag method to address blocking behavior in the analytics tracking mechanism. The changes convert the method from async-await to a synchronous signature using Task.FromResult, and modify the way analytics events are triggered.

  • Converted GetFlag to non-async, returning a task via Task.FromResult.
  • Changed analytics tracking to a fire-and-forget call.
Comments suppressed due to low confidence (1)

Flagsmith.FlagsmithClient/Flags.cs:23

  • Changing from an async method to a synchronous signature using Task.FromResult alters exception propagation; verify that this change does not lead to unhandled errors, especially when using throw expressions within Task.FromResult.
public Task<IFlag> GetFlag(string featureName)

@khvn26 khvn26 merged commit 06afacc into main May 23, 2025
10 checks passed
@khvn26 khvn26 deleted the fix/blocking-analytics-processor branch May 23, 2025 10:58
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

Successfully merging this pull request may close these issues.

Analytics update is blocking

3 participants