Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
486f895
[alerts] Hotfix: migrated to the new events collection
Sep 29, 2025
88af2ee
[alerts] Hotfix: migrated to the new events collection
Sep 29, 2025
6515105
Merge branch 'master' into SER-2584-alerts-migrate-event-and-rating-m…
Sep 29, 2025
e28c508
Updated changelog
Sep 29, 2025
94a6da8
[alerts] Hotfix: migrated to the new events collection
Sep 29, 2025
d33b81c
Merge branch 'master' into SER-2584-alerts-migrate-event-and-rating-m…
Sep 30, 2025
7b35d69
Merge pull request #6718 from Countly/SER-2584-alerts-migrate-event-a…
cihadtekin Oct 2, 2025
95cae2c
Update changelog
widatama Oct 1, 2025
b9a2842
Merge pull request #6730 from Countly/user-custom-update
widatama Oct 3, 2025
a7920c3
Update CHANGELOG.md
coskunaydinoglu Oct 3, 2025
2452d54
Merge pull request #6735 from Countly/SER-2580-Missing-state-in-oidc
coskunaydinoglu Oct 3, 2025
84dc9d7
fix: make created app persistent after page reload
gabrieloliveirapinto Oct 3, 2025
d8cf1a1
Merge remote-tracking branch 'origin/master' into SER-2520-when-the-u…
gabrieloliveirapinto Oct 3, 2025
4725bec
Update changelog
widatama Oct 6, 2025
02718d5
Merge pull request #6737 from Countly/SER-2520-when-the-user-creates-…
gabrieloliveirapinto Oct 6, 2025
67c0e28
chore: Changelog Update
gabrieloliveirapinto Oct 6, 2025
041e618
Merge pull request #6741 from Countly/changelog-update-for-app-creati…
gabrieloliveirapinto Oct 6, 2025
45a28cb
Merge branch 'master' into drill-srv
widatama Oct 6, 2025
f5c1148
Merge pull request #6740 from Countly/drill-srv
widatama Oct 6, 2025
eaefc22
Merge remote-tracking branch 'origin/next' into master-to-next
gabrieloliveirapinto Oct 6, 2025
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
Dependencies:
- Remove SQLite

## Version 25.03.X
Fixes:
- [alerts] Fix: Migrate alerts to the new events model
- [oidc] Fix for session state storage
- [applications] Persist newly created app after page reload

Enterprise Fixes:
- [users] Update user custom field number formatting
- [users] Fix condition for custom property update
- [drill] [survey] Fix duplicate question id
- [drill] [survey] Display survey answer value instead of id in drill result

## Version 25.03.21
Fixes:
- [feedback] Prevent showing the application when switching between the NPS and Survey pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
});
self.$store.dispatch("countlyCommon/addToAllApps", data);
self.$store.dispatch("countlyCommon/updateActiveApp", data._id + "");
countlyCommon.setActiveApp(data._id);
if (self.firstApp) {
countlyCommon.ACTIVE_APP_ID = data._id + "";
app.onAppManagementSwitch(data._id + "", data && data.type || "mobile");
Expand Down Expand Up @@ -892,4 +893,4 @@
return countlyGlobal.timezones;
}
};
})();
})();
21 changes: 9 additions & 12 deletions plugins/alerts/api/alertModules/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @typedef {import('../parts/common-lib.js').App} App
*/

const crypto = require('crypto');
const log = require('../../../../api/utils/log.js')('alert:events');
const moment = require('moment-timezone');
const common = require('../../../../api/utils/common.js');
Expand Down Expand Up @@ -101,14 +100,10 @@ async function getEventMetricByDate(app, event, metric, date, period, segments)
if (segments) {
segmentKeys = Object.keys(segments);
}

const collectionName = "events" + crypto
.createHash('sha1')
.update(event + app._id.toString())
.digest('hex');

const records = await common.db.collection(collectionName)
const records = await common.db.collection("events_data")
.find({
a: app._id.toString(),
e: event,
m: monthFilter,
s: { $in: segmentKeys },
})
Expand Down Expand Up @@ -162,11 +157,13 @@ async function getEventMetricByDate(app, event, metric, date, period, segments)
}
/*
(async function() {
if (!require("cluster").isPrimary) {
return;
}
await new Promise(res => setTimeout(res, 2000));
const app = { _id: "65c1f875a12e98a328d5eb9e", timezone: "Europe/Istanbul" };
const date = new Date("2024-01-02T12:47:19.247Z");
const date2 = new Date("2024-01-03T13:47:19.247Z");
const event = "Checkout";
const app = { _id: "67fff00d901abe2f8cc57646", timezone: "Europe/Istanbul" };
const date = new Date("2025-02-02T12:47:19.247Z");
const event = "Product Viewed";
const prop = "c";

const hourly = await getEventMetricByDate(app, event, prop, date, "hourly");
Expand Down
23 changes: 12 additions & 11 deletions plugins/alerts/api/alertModules/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @typedef {import('../parts/common-lib.js').App} App
*/

const crypto = require('crypto');
const log = require('../../../../api/utils/log.js')('alert:rating');
const moment = require('moment-timezone');
const common = require('../../../../api/utils/common.js');
Expand Down Expand Up @@ -111,14 +110,13 @@ module.exports.check = async function({ alertConfigs: alert, done, scheduledTo:
async function getRatingResponsesByDate(app, widgetId, date, period, ratings) {
const { years } = commonLib.getDateComponents(date, app.timezone);
const eventName = "[CLY]_star_rating";
const collectionName = "events" + crypto
.createHash('sha1')
.update(eventName + app._id.toString())
.digest('hex');

// find all segment values:
const records = await common.db.collection(collectionName)
.find({ m: String(years) + ":0" })
const records = await common.db.collection("events_data")
.find({
a: app._id.toString(),
e: eventName,
m: String(years) + ":0",
})
.toArray();
const segmentValueSet = new Set;
for (const record of records) {
Expand Down Expand Up @@ -154,10 +152,13 @@ async function getRatingResponsesByDate(app, widgetId, date, period, ratings) {

/*
(async function() {
if (!require("cluster").isPrimary) {
return;
}
await new Promise(res => setTimeout(res, 2000));
const app = { _id: ObjectId("65c1f875a12e98a328d5eb9e"), timezone: "Europe/Istanbul" };
const date = new Date("2024-02-07T12:00:00.000Z");
const widgetId = "65c383fbb46a4d172d7c58e1";
const app = { _id: new ObjectId("68ca8d133bded4a5d888bb45"), timezone: "Europe/Istanbul" };
const date = new Date("2025-09-29T12:47:19.247Z");
const widgetId = "68ca8d133bded4a5d888bb4a";
let monthlyData = await getRatingResponsesByDate(app, widgetId, date, "monthly", [1, 2, 3, 4, 5]);
let dailyData = await getRatingResponsesByDate(app, widgetId, date, "daily");
console.log(monthlyData, dailyData);
Expand Down
Loading