Skip to content

Commit 84d49ef

Browse files
authored
Merge pull request #532 from Countly/staging
Staging 24.11.0
2 parents d361ae0 + 99be37d commit 84d49ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2052
-1309
lines changed

.eslintignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ node_modules
77
.github
88
.gitignore
99
CHANGELOG.md
10-
cypress.json
10+
cypress.config.js
1111
generateDocs.sh
1212
jsdoc_conf.json
13-
LICENSE
13+
LICENSE
14+
cypress/

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build-and-test:
1414
strategy:
1515
matrix:
16-
node-version: [12.x, 14.x, 16.x]
16+
node-version: [14.x, 16.x, 18.x, 20.x]
1717

1818
runs-on: ubuntu-latest
1919

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 24.11.0
2+
- Mitigated an issue where SDK could try to send old stored offline mode data during init if `clear_stored_id` was true
3+
- Mitigated an issue where the SDK could stayed on offline mode after the first init with `offline_mode` set to true
4+
- Mitigated an issue where old Rating widget stickers were not cleared when a new one was presented
5+
6+
- Improved view tracking logic
7+
- Default request method is now set to "POST"
8+
- Healtchecks won't be sent in offline mode anymore
9+
- Added a new interface 'feedback' which includes convenience methods to show feedback widgets:
10+
- showNPS([String nameIDorTag]) - for displaying the first available NPS widget or one with the given name, Tag or ID value
11+
- showSurvey([String nameIDorTag]) - for displaying the first available Survey widget or one with the given name, Tag or ID value
12+
- showRating([String nameIDorTag]) - for displaying the first available Rating widget or one with the given name, Tag or ID value
13+
114
## 24.4.1
215
- Added types for the SDK
316
- Added a new method `set_id(newDeviceId)` for managing device ID changes according to the device ID Type

cypress.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { defineConfig } = require('cypress')
2+
module.exports = defineConfig({
3+
e2e: {
4+
setupNodeEvents(on, config) {
5+
// implement node event listeners here
6+
},
7+
},
8+
userAgent: "abcd",
9+
});

cypress.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/* eslint-disable cypress/no-unnecessary-waiting */
21
/* eslint-disable require-jsdoc */
32
var Countly = require("../../lib/countly");
4-
// import * as Countly from "../../dist/countly_umd.js";
5-
var hp = require("../support/helper.js");
3+
var hp = require("../support/helper");
64

75
function initMain(clear) {
86
Countly.init({
@@ -62,22 +60,22 @@ describe("Test Countly.q related methods and processes", () => {
6260
// Check that the .q is empty
6361
expect(Countly.q.length).to.equal(0);
6462

65-
cy.fetch_local_request_queue().then((rq_2) => {
63+
cy.fetch_local_request_queue().then((rq) => {
6664
// Check that nothing sent to request queue
67-
expect(rq_2.length).to.equal(0);
65+
expect(rq.length).to.equal(0);
6866
cy.fetch_local_event_queue().then((eq) => {
6967
// Check that events are now in event queue
7068
expect(eq.length).to.equal(4);
7169

7270
// Send events from event queue to request queue
7371
Countly._internals.sendEventsForced();
74-
cy.fetch_local_event_queue().then((eq_2) => {
72+
cy.fetch_local_event_queue().then((eq) => {
7573
// Check that event queue is empty
76-
expect(eq_2.length).to.equal(0);
77-
cy.fetch_local_request_queue().then((rq_3) => {
74+
expect(eq.length).to.equal(0);
75+
cy.fetch_local_request_queue().then((rq) => {
7876
// Check that events are now in request queue
79-
expect(rq_3.length).to.equal(1);
80-
const eventsArray = JSON.parse(rq_3[0].events);
77+
expect(rq.length).to.equal(1);
78+
const eventsArray = JSON.parse(rq[0].events);
8179
expect(eventsArray[0].key).to.equal("event_1");
8280
expect(eventsArray[1].key).to.equal("event_2");
8381
expect(eventsArray[2].key).to.equal("event_3");
@@ -125,16 +123,16 @@ describe("Test Countly.q related methods and processes", () => {
125123
// Check that event queue has new device ID's orientation event
126124
expect(eq.length).to.equal(1);
127125
expect(eq[0].key).to.equal("[CLY]_orientation");
128-
cy.fetch_local_request_queue().then((rq_2) => {
126+
cy.fetch_local_request_queue().then((rq) => {
129127
// Check that events are now in request queue (second request is begin session for new device ID)
130-
expect(rq_2.length).to.equal(2);
131-
const eventsArray = JSON.parse(rq_2[0].events);
128+
expect(rq.length).to.equal(2);
129+
const eventsArray = JSON.parse(rq[0].events);
132130
expect(eventsArray[0].key).to.equal("event_1");
133131
expect(eventsArray[1].key).to.equal("event_2");
134132
expect(eventsArray[2].key).to.equal("event_3");
135133
expect(eventsArray[3].key).to.equal("event_4");
136134
// check begin session
137-
expect(rq_2[1].begin_session).to.equal(1);
135+
expect(rq[1].begin_session).to.equal(1);
138136
});
139137
});
140138
});
@@ -175,16 +173,16 @@ describe("Test Countly.q related methods and processes", () => {
175173
cy.fetch_local_event_queue().then((eq) => {
176174
// Check that event queue is empty
177175
expect(eq.length).to.equal(0);
178-
cy.fetch_local_request_queue().then((rq_2) => {
176+
cy.fetch_local_request_queue().then((rq) => {
179177
// Check that events are now in request queue (second request is user details)
180-
expect(rq_2.length).to.equal(2);
181-
const eventsArray = JSON.parse(rq_2[0].events);
178+
expect(rq.length).to.equal(2);
179+
const eventsArray = JSON.parse(rq[0].events);
182180
expect(eventsArray[0].key).to.equal("event_1");
183181
expect(eventsArray[1].key).to.equal("event_2");
184182
expect(eventsArray[2].key).to.equal("event_3");
185183
expect(eventsArray[3].key).to.equal("event_4");
186184
// check user details
187-
const user_details = JSON.parse(rq_2[1].user_details);
185+
const user_details = JSON.parse(rq[1].user_details);
188186
expect(user_details.name).to.equal("test_user");
189187
});
190188
});
@@ -227,16 +225,16 @@ describe("Test Countly.q related methods and processes", () => {
227225
cy.fetch_local_event_queue().then((eq) => {
228226
// Check that event queue is empty
229227
expect(eq.length).to.equal(0);
230-
cy.fetch_local_request_queue().then((rq_2) => {
228+
cy.fetch_local_request_queue().then((rq) => {
231229
// Check that events are now in request queue (second request is user details)
232-
expect(rq_2.length).to.equal(2);
233-
const eventsArray = JSON.parse(rq_2[0].events);
230+
expect(rq.length).to.equal(2);
231+
const eventsArray = JSON.parse(rq[0].events);
234232
expect(eventsArray[0].key).to.equal("event_1");
235233
expect(eventsArray[1].key).to.equal("event_2");
236234
expect(eventsArray[2].key).to.equal("event_3");
237235
expect(eventsArray[3].key).to.equal("event_4");
238236
// check user data
239-
const user_details = JSON.parse(rq_2[1].user_details);
237+
const user_details = JSON.parse(rq[1].user_details);
240238
expect(user_details.custom.name).to.equal("test_user");
241239
});
242240
});
@@ -267,15 +265,15 @@ describe("Test Countly.q related methods and processes", () => {
267265
expect(Countly.q.length).to.equal(4);
268266
// Wait for heartBeat to process the .q
269267
cy.wait(1500).then(() => {
270-
// Check that the .q is empty
268+
// Check that the .q is empty
271269
expect(Countly.q.length).to.equal(0);
272-
cy.fetch_local_event_queue().then((eq_2) => {
273-
// Check that event queue is empty as all must be in request queue
274-
expect(eq_2.length).to.equal(0);
275-
cy.fetch_local_request_queue().then((rq_2) => {
276-
// Check that events are now in request queue
277-
expect(rq_2.length).to.equal(1);
278-
const eventsArray = JSON.parse(rq_2[0].events);
270+
cy.fetch_local_event_queue().then((eq) => {
271+
// Check that event queue is empty as all must be in request queue
272+
expect(eq.length).to.equal(0);
273+
cy.fetch_local_request_queue().then((rq) => {
274+
// Check that events are now in request queue
275+
expect(rq.length).to.equal(1);
276+
const eventsArray = JSON.parse(rq[0].events);
279277
expect(eventsArray[0].key).to.equal("event_1");
280278
expect(eventsArray[1].key).to.equal("event_2");
281279
expect(eventsArray[2].key).to.equal("event_3");
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable cypress/no-unnecessary-waiting */
22
/* eslint-disable require-jsdoc */
33
var Countly = require("../../lib/countly");
4-
// import * as Countly from "../../dist/countly_umd.js";
54
var hp = require("../support/helper.js");
65

76
function initMain(name, version) {
@@ -16,13 +15,13 @@ function initMain(name, version) {
1615
}
1716

1817
const SDK_NAME = "javascript_native_web";
19-
const SDK_VERSION = "24.4.1";
18+
const SDK_VERSION = "24.11.0";
2019

2120
// tests
2221
describe("Bridged SDK Utilities Tests", () => {
2322
it("Check if we can override sdk name and version successful", () => {
2423
hp.haltAndClearStorage(() => {
25-
initMain("javascript_gtm_web", "24.0.0");
24+
initMain('javascript_gtm_web', '24.0.0');
2625
hp.events();
2726
cy.fetch_local_request_queue().then((eq) => {
2827
expect(eq).to.have.length(1);
@@ -33,7 +32,7 @@ describe("Bridged SDK Utilities Tests", () => {
3332
});
3433
it("Check if SDK uses default values if SDK name and version was not overriden", () => {
3534
hp.haltAndClearStorage(() => {
36-
initMain(undefined, undefined);
35+
initMain(undefined, undefined);
3736
hp.events();
3837
cy.fetch_local_request_queue().then((eq) => {
3938
expect(eq).to.have.length(1);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* eslint-disable cypress/no-unnecessary-waiting */
22
/* eslint-disable require-jsdoc */
33
var Countly = require("../../lib/countly");
4-
var hp = require("../support/helper");
4+
// import * as Countly from "../../dist/countly_umd.js";
5+
var hp = require("../support/helper.js");
56

67
function initMain(consent) {
78
Countly.init({
89
app_key: "YOUR_APP_KEY",
9-
url: "https://your.domain.countly",
10+
url: "https://your.domain.count.ly",
1011
require_consent: consent,
1112
device_id: "György Ligeti",
1213
test_mode: true,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var hp = require("../support/helper");
55
function initMain() {
66
Countly.init({
77
app_key: "YOUR_APP_KEY",
8-
url: "https://your.domain.countly",
8+
url: "https://your.domain.count.ly",
99
test_mode: true
1010
});
1111
}
@@ -26,7 +26,7 @@ describe("Crashes tests ", () => {
2626
catch (err) {
2727
Countly.log_error(err);
2828
}
29-
cy.wait(3000).then(() => {
29+
cy.wait(1000).then(() => {
3030
cy.fetch_local_request_queue().then((rq) => {
3131
cy.check_crash(rq[0], hp.appKey);
3232
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var hp = require("../support/helper");
55
function initMain(deviceId, offline, searchQuery, clear, rq, eq) {
66
Countly.init({
77
app_key: "YOUR_APP_KEY",
8-
url: "https://your.domain.countly",
8+
url: "https://your.domain.count.ly",
99
device_id: deviceId,
1010
test_mode: rq,
1111
test_mode_eq: eq,

0 commit comments

Comments
 (0)