-
Couldn't load subscription status.
- Fork 10
1049 bug no events triggered before gameplay despite video start #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
ab218d6
0fc25a6
cb80df0
f65e781
a219102
294ce44
6cc0831
51ec842
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ use crate::mixpanel::state::MixpanelState; | |||||
|
|
||||||
| #[server] | ||||||
| async fn track_event_server_fn(props: Value) -> Result<(), ServerFnError> { | ||||||
| leptos::logging::log!("Init event served"); | ||||||
| use axum::http::HeaderMap; | ||||||
| use axum_extra::headers::UserAgent; | ||||||
| use axum_extra::TypedHeader; | ||||||
|
|
@@ -130,10 +131,23 @@ pub fn parse_query_params_utm() -> Result<Vec<(String, String)>, String> { | |||||
| Ok(Vec::new()) | ||||||
| } | ||||||
|
|
||||||
| pub async fn init_event(user_principal: Option<String>) { | ||||||
| leptos::logging::log!("Init event {:?})", user_principal); | ||||||
|
||||||
| leptos::logging::log!("Init event {:?})", user_principal); | |
| leptos::logging::log!("Init event {:?}", user_principal); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||||||||
| use codee::string::FromToStringCodec; | ||||||||||||||||||||||
| use consts::AUTH_UTIL_COOKIES_MAX_AGE_MS; | ||||||||||||||||||||||
| use leptos::prelude::*; | ||||||||||||||||||||||
| use leptos_use::{use_cookie_with_options, UseCookieOptions}; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| pub struct Storage; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| impl Storage { | ||||||||||||||||||||||
| pub fn uuid_get_or_init(key: &str) -> String { | ||||||||||||||||||||||
| let (uuid, set_uuid) = use_cookie_with_options::<String, FromToStringCodec>( | ||||||||||||||||||||||
| key, | ||||||||||||||||||||||
| UseCookieOptions::default() | ||||||||||||||||||||||
| .path("/") | ||||||||||||||||||||||
| .max_age(AUTH_UTIL_COOKIES_MAX_AGE_MS), | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| let uuid_value = uuid.get_untracked(); | ||||||||||||||||||||||
| if let Some(uuid) = uuid_value { | ||||||||||||||||||||||
| uuid | ||||||||||||||||||||||
|
Comment on lines
+17
to
+18
|
||||||||||||||||||||||
| if let Some(uuid) = uuid_value { | |
| uuid | |
| if let Some(ref uuid) = uuid_value { | |
| if !uuid.is_empty() { | |
| uuid.clone() | |
| } else { | |
| let new_device_id = uuid::Uuid::new_v4().to_string(); | |
| set_uuid.set(Some(new_device_id.clone())); | |
| new_device_id | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This debug log message is misleading as it appears in the general
track_event_server_fnfunction, not specifically for init events. This will log for all events tracked through this function, which could be confusing when debugging.