You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cypress/integration/async_queue.js
+3-42
Original file line number
Diff line number
Diff line change
@@ -41,16 +41,17 @@ describe("Test Countly.q related methods and processes", () => {
41
41
expect(Countly.q.length).to.equal(0);
42
42
43
43
// Add 4 events to the .q
44
+
Countly.q.push(["track_errors"]);// adding this as calling it during init used to cause an error (at v23.12.5)
44
45
Countly.q.push(["add_event",event(1)]);
45
46
Countly.q.push(["add_event",event(2)]);
46
47
Countly.q.push(["add_event",event(3)]);
47
48
Countly.q.push(["add_event",event(4)]);
48
49
// Check that the .q has 4 events
49
-
expect(Countly.q.length).to.equal(4);
50
+
expect(Countly.q.length).to.equal(5);
50
51
51
52
cy.fetch_local_event_queue().then((rq)=>{
52
53
// Check that events are still in .q
53
-
expect(Countly.q.length).to.equal(4);
54
+
expect(Countly.q.length).to.equal(5);
54
55
55
56
// Check that the event queue is empty
56
57
expect(rq.length).to.equal(0);
@@ -139,46 +140,6 @@ describe("Test Countly.q related methods and processes", () => {
139
140
});
140
141
});
141
142
});
142
-
// This test checks if clear_stored_id set to true during init we call processAsyncQueue (it sends events from .q to event queue and then to request queue)
143
-
it("Check clear_stored_id set to true empties the .q",()=>{
144
-
hp.haltAndClearStorage(()=>{
145
-
// Disable heartbeat
146
-
Countly.noHeartBeat=true;
147
-
Countly.q=[];
148
-
localStorage.setItem("YOUR_APP_KEY/cly_id","old_user_id");// Set old device ID for clear_stored_id to work
149
-
150
-
// Add 4 events to the .q
151
-
Countly.q.push(["add_event",event(1)]);
152
-
Countly.q.push(["add_event",event(2)]);
153
-
Countly.q.push(["add_event",event(3)]);
154
-
Countly.q.push(["add_event",event(4)]);
155
-
156
-
// Check that the .q has 4 events
157
-
expect(Countly.q.length).to.equal(4);
158
-
159
-
// Init the SDK with clear_stored_id set to true
160
-
initMain(true);
161
-
cy.wait(1000);
162
-
163
-
// Check that the .q is empty
164
-
expect(Countly.q.length).to.equal(0);
165
-
166
-
cy.fetch_local_event_queue().then((rq)=>{
167
-
// Check that the event queue is empty because processAsyncQueue sends events from .q to event queue and then to request queue
168
-
expect(rq.length).to.equal(0);
169
-
170
-
cy.fetch_local_request_queue().then((rq_2)=>{
171
-
// Check that events are now in request queue
172
-
expect(rq_2.length).to.equal(1);
173
-
consteventsArray=JSON.parse(rq_2[0].events);
174
-
expect(eventsArray[0].key).to.equal("event_1");
175
-
expect(eventsArray[1].key).to.equal("event_2");
176
-
expect(eventsArray[2].key).to.equal("event_3");
177
-
expect(eventsArray[3].key).to.equal("event_4");
178
-
});
179
-
});
180
-
});
181
-
});
182
143
// This test checks if calling user_details triggers processAsyncQueue (it sends events from .q to event queue and then to request queue)
Copy file name to clipboardexpand all lines: lib/countly.js
+9-4
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,7 @@
196
196
statusCode: "cly_hc_status_code",
197
197
errorMessage: "cly_hc_error_message"
198
198
});
199
-
varSDK_VERSION="23.12.5";
199
+
varSDK_VERSION="23.12.6";
200
200
varSDK_NAME="javascript_native_web";
201
201
202
202
// Using this on document.referrer would return an array with 17 elements in it. The 12th element (array[11]) would be the path we are looking for. Others would be things like password and such (use https://regex101.com/ to check more)
@@ -956,8 +956,7 @@
956
956
log(logLevelEnums.DEBUG,"initialize, No device ID type info from the previous session, falling back to DEVELOPER_SUPPLIED, for event flushing");
0 commit comments