(&mut self)
| 2914 | } |
| 2915 | |
| 2916 | fn create_optimistic_session(&mut self) -> String { |
| 2917 | let now = Utc::now(); |
| 2918 | let session_id = format!("local_session_{}", now.timestamp_millis()); |
| 2919 | let session = Session { |
| 2920 | id: session_id.clone(), |
| 2921 | title: "New Session".to_string(), |
| 2922 | created_at: now, |
| 2923 | updated_at: now, |
| 2924 | parent_id: None, |
| 2925 | share: None, |
| 2926 | }; |
| 2927 | |
| 2928 | let mut session_ctx = self.context.session.write(); |
| 2929 | session_ctx.upsert_session(session); |
| 2930 | session_ctx.messages.entry(session_id.clone()).or_default(); |
| 2931 | session_ctx.set_status(&session_id, SessionStatus::Idle); |
| 2932 | session_id |
| 2933 | } |
| 2934 | |
| 2935 | fn remove_optimistic_session(&mut self, session_id: &str) { |
| 2936 | let mut session_ctx = self.context.session.write(); |
no test coverage detected