try fix bugs
This commit is contained in:
@@ -201,9 +201,9 @@ async function createSessionEnd(
|
||||
) {
|
||||
const properties: Record<string, unknown> = {};
|
||||
if (options.screenViews === 1) {
|
||||
properties._bounce = true;
|
||||
properties.__bounce = true;
|
||||
} else {
|
||||
properties._bounce = false;
|
||||
properties.__bounce = false;
|
||||
}
|
||||
|
||||
const session: IServiceCreateEventPayload = {
|
||||
|
||||
@@ -164,16 +164,11 @@ export async function postEvent(
|
||||
return reply.status(200).send('');
|
||||
}
|
||||
|
||||
const [geo, eventsJobs, events] = await Promise.all([
|
||||
const [geo, eventsJobs] = await Promise.all([
|
||||
parseIp(ip),
|
||||
eventsQueue.getJobs(['delayed']),
|
||||
getEvents(
|
||||
`SELECT * FROM events WHERE name = 'session_start' AND profile_id = '${profileId}' AND project_id = '${projectId}' ORDER BY created_at DESC LIMIT 1`
|
||||
),
|
||||
]);
|
||||
|
||||
const sessionStartEvent = events[0];
|
||||
|
||||
// find session_end job
|
||||
const sessionEndJobCurrentDeviceId = findJobByPrefix(
|
||||
eventsJobs,
|
||||
@@ -216,6 +211,10 @@ export async function postEvent(
|
||||
);
|
||||
}
|
||||
|
||||
const [sessionStartEvent] = await getEvents(
|
||||
`SELECT * FROM events WHERE name = 'session_start' AND device_id = '${deviceId}' AND project_id = '${projectId}' ORDER BY created_at DESC LIMIT 1`
|
||||
);
|
||||
|
||||
request.log.info(
|
||||
{
|
||||
ip,
|
||||
@@ -228,7 +227,8 @@ export async function postEvent(
|
||||
deviceId,
|
||||
bot,
|
||||
geo,
|
||||
events,
|
||||
sessionStartEvent,
|
||||
path,
|
||||
},
|
||||
'incoming event'
|
||||
);
|
||||
|
||||
@@ -108,7 +108,7 @@ export function EventListItem(props: EventListItemProps) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'OS cersion',
|
||||
name: 'OS version',
|
||||
value: osVersion,
|
||||
onClick() {
|
||||
setFilter('os_version', osVersion ?? '');
|
||||
|
||||
@@ -60,7 +60,7 @@ export async function createSessionEnd(
|
||||
...sessionStart,
|
||||
properties: {
|
||||
...sessionStart.properties,
|
||||
_bounce: screenViews.length <= 1,
|
||||
__bounce: screenViews.length <= 1,
|
||||
},
|
||||
name: 'session_end',
|
||||
duration: sessionDuration,
|
||||
|
||||
Reference in New Issue
Block a user