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

HC empty string issue #487

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## 24.4.0
- Improved Health Check feature stability
- Added support for Feedback Widget terms and conditions

## 23.12.6
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/health_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("Health Check tests ", () => {
// Test the 'hc' parameter
const hcParam = url.searchParams.get("hc");
const hcParamObj = JSON.parse(hcParam);
expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "\"\"" });
expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "" });

// Test the 'metrics' parameter
const metricsParam = url.searchParams.get("metrics");
Expand Down
6 changes: 5 additions & 1 deletion lib/countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -5335,12 +5335,16 @@
function sendInstantHCRequest() {
// truncate error message to 1000 characters
var curbedMessage = truncateSingleValue(self.hcErrorMessage, 1000, "healthCheck", log);
// due to some server issues we pass empty string as is
if (curbedMessage !== "") {
curbedMessage = JSON.stringify(curbedMessage);
}
// prepare hc object
var hc = {
el: self.hcErrorCount,
wl: self.hcWarningCount,
sc: self.hcStatusCode,
em: JSON.stringify(curbedMessage)
em: curbedMessage
};
// prepare request
var request = {
Expand Down
Loading