Watch
1
0
Fork
You've already forked souveraine
0

handlers: session_or_hydrate returns the dashmap guard, not Arc

the session index holds values; get() hands back a Ref tied to the map
borrow. The Arc-typed helper was a type error on its first CI run.
This commit is contained in:
Fimeg 2026-08-18 11:01:37 -04:00
commit 9e147093ec

View file

@ -4,10 +4,11 @@ use crate::server::SouveraineServer;
/// Resolve a session, hydrating from disk when a freshly booted server has
/// not loaded this conversation yet. Surfaces hold conversation ids, not a
/// map; a restart must answer a held id without a prior listing.
async fn session_or_hydrate(
server: &SouveraineServer,
async fn session_or_hydrate<'a>(
server: &'a SouveraineServer,
id: &str,
) -> Result<Arc<crate::server::session_manager::Session>, ApiError> {
) -> Result<dashmap::mapref::one::Ref<'a, String, crate::server::session_manager::Session>, ApiError>
{
if let Some(session) = server.sessions.get(id) {
return Ok(session);
}