Skip to content

Commit 51f365e

Browse files
authored
Merge pull request #39 from Countly/25.4.1
new release 25.4.1
2 parents 1ba98ca + 0727404 commit 51f365e

File tree

9 files changed

+980
-41
lines changed

9 files changed

+980
-41
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 25.4.1
2+
3+
* Added automatic backoff mechanism which delays sending requests if server seems busy
4+
* Added `disable_sdk_behavior_settings_updates` init method for disabling Server Configuration sync requests
5+
* Added `disable_backoff_mechanism` init method for disabling backoff mechanism
6+
* Added timezone support for server
7+
18
## 25.4.0
29

310
* ! Minor Breaking Change ! SDK now has Server Configuration feature and it is enabled by default. Changes made on SDK Manager > SDK Configuration on your server will affect SDK behavior directly.
@@ -10,7 +17,7 @@
1017

1118
* Added `refreshContentZone` method to Content interface for refreshing Content Zone requests
1219
* Added `behavior_settings` init time method for providing server configuration during first initialization
13-
* Added `content_whitelist` init time method that lets you whitelist your other domains for diplaying Content
20+
* Added `content_whitelist` init time method that lets you whitelist your other domains for displaying Content
1421

1522
* `max_logs` config option value will not be used anymore (use `max_breadcrumb_count` instead)
1623

cypress.config.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,66 @@ export default defineConfig({
1010
codeCoverageTask(on, config);
1111

1212
// Include any other plugin code...
13+
const http = require('http');
14+
let server = null;
15+
let responseDelay = 0;
16+
let requests = [];
17+
18+
on('task', {
19+
startServer() {
20+
return new Promise((resolve) => {
21+
requests = [];
22+
server = http.createServer((req, res) => {
23+
res.setHeader('Access-Control-Allow-Origin', '*');
24+
res.setHeader('Access-Control-Allow-Methods', 'GET,POST,OPTIONS');
25+
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
26+
27+
if (req.method === 'OPTIONS') {
28+
res.writeHead(204);
29+
return res.end();
30+
}
31+
32+
let body = '';
33+
req.on('data', chunk => { body += chunk; });
34+
req.on('end', () => {
35+
requests.push({ method: req.method, url: req.url, headers: req.headers, body });
36+
setTimeout(() => {
37+
res.writeHead(200, { 'Content-Type': 'application/json' });
38+
res.end(JSON.stringify({ result: 'Success' }));
39+
}, responseDelay);
40+
});
41+
});
42+
server.listen(9000, () => {
43+
console.log('Test server running on http://localhost:9000');
44+
resolve(null);
45+
});
46+
});
47+
},
48+
stopServer() {
49+
return new Promise((resolve) => {
50+
if (server) {
51+
server.close(() => {
52+
requests = [];
53+
console.log('Test server stopped');
54+
resolve(null);
55+
});
56+
} else {
57+
resolve(null);
58+
}
59+
});
60+
},
61+
setResponseDelay(ms) {
62+
responseDelay = ms;
63+
return null;
64+
},
65+
getRequests() {
66+
return requests;
67+
},
68+
clearRequests() {
69+
requests = [];
70+
return null;
71+
},
72+
});
1373

1474
// IMPORTANT: Return the config object with any changed environment variables
1575
return config;

cypress/e2e/health_check.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("Health Check tests", () => {
2121

2222
const hcParam = params.get("hc");
2323
const hcParamObj = JSON.parse(decodeURIComponent(hcParam));
24-
expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "" });
24+
expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "", bom: 0, cbom: 0 });
2525

2626
const metricsParam = params.get("metrics");
2727
expect(metricsParam).to.equal("{\"_app_version\":\"0.0\",\"_ua\":\"abcd\"}");

0 commit comments

Comments
 (0)