Skip to content

CF RAY improvements#78

Open
novalisdenahi wants to merge 6 commits into
masterfrom
cf-ray-improvements
Open

CF RAY improvements#78
novalisdenahi wants to merge 6 commits into
masterfrom
cf-ray-improvements

Conversation

@novalisdenahi
Copy link
Copy Markdown
Contributor

Describe the purpose of your pull request

  • 1102 and 1103 log events logs cfRayId if present.
  • SonarQube fixes
    • AppStateMonitor registerReceiver flag set to RECEIVER_NOT_EXPORTED on Android build 33 or higher.
    • ConfigFetcher possible resource leak fixed.

Related issues (only if applicable)

How to test? (only if applicable)

  • What part of the application was affected by the changes? What should be tested?

Security (only if applicable)

  • Describe any potential risks that could affect the component in terms of security.

Requirement checklist (only if applicable)

  • I have covered the applied changes with automated tests.
  • I have executed the full automated test set against my changes.
  • I have validated my changes against all supported platform versions.
  • I have read and accepted the contribution agreement.

@novalisdenahi novalisdenahi requested a review from a team as a code owner May 30, 2026 09:41
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

@adams85 adams85 left a comment

Choose a reason for hiding this comment

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

Nothing blocker, just some minor observations:

} catch (Exception e) {
if(fetcher != null) fetcher.close();
if(monitor != null) monitor.close();
this.logger.error(0, "ConfigCatClient initialization failed.", e);
Copy link
Copy Markdown
Contributor

@adams85 adams85 Jun 1, 2026

Choose a reason for hiding this comment

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

Since ConfigCatClient.get throws an exception with the same message, logging this issue looks somewhat redundant. (I mean you can't really miss the exception anyway.)

Suggested change
this.logger.error(0, "ConfigCatClient initialization failed.", e);

FormattableLogMessage message = ConfigCatLogMessages.getFetchFailedDueToUnexpectedError(cfRayId);
logger.error(1103, message, e);
result.complete(FetchResponse.failed(message + " " + e.getMessage(), false, null));
fetchResponse = FetchResponse.failed(message + " " + e.getMessage(), false, cfRayId);
Copy link
Copy Markdown
Contributor

@adams85 adams85 Jun 1, 2026

Choose a reason for hiding this comment

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

There's a minor inconsistency here compared to the Java SDK, which doesn't append e.getMessage() to the message returned by getFetchFailedDueToUnexpectedError.

I'm not sure which approach is the better.

The best solution is to store the exception in the FetchResponse object and expose it to the user via RefreshResult. But this is the subject of another ticket.

So we can leave this as is for now, I guess.

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.

2 participants