@@ -18,7 +18,6 @@ const schema = z.object({
1818 payload : z . object ( {
1919 website : z . string ( ) . uuid ( ) ,
2020 data : anyObjectParam . optional ( ) ,
21- id : z . string ( ) . optional ( ) ,
2221 hostname : z . string ( ) . max ( 100 ) . optional ( ) ,
2322 language : z . string ( ) . max ( 35 ) . optional ( ) ,
2423 referrer : urlOrPathParam . optional ( ) ,
@@ -30,6 +29,7 @@ const schema = z.object({
3029 ip : z . string ( ) . ip ( ) . optional ( ) ,
3130 userAgent : z . string ( ) . optional ( ) ,
3231 timestamp : z . coerce . number ( ) . int ( ) . optional ( ) ,
32+ id : z . string ( ) . optional ( ) ,
3333 } ) ,
3434} ) ;
3535
@@ -55,7 +55,7 @@ export async function POST(request: Request) {
5555 title,
5656 tag,
5757 timestamp,
58- id,
58+ id = '' ,
5959 } = payload ;
6060
6161 // Cache check
@@ -99,7 +99,7 @@ export async function POST(request: Request) {
9999 const sessionSalt = hash ( startOfMonth ( createdAt ) . toUTCString ( ) ) ;
100100 const visitSalt = hash ( startOfHour ( createdAt ) . toUTCString ( ) ) ;
101101
102- const sessionId = uuid ( websiteId , ip , userAgent , sessionSalt , id ? id : '' ) ;
102+ const sessionId = uuid ( websiteId , ip , userAgent , sessionSalt , id ) ;
103103
104104 // Find session
105105 if ( ! clickhouse . enabled && ! cache ?. sessionId ) {
0 commit comments