Skip to main content

get_latest_developer_message_text

Function get_latest_developer_message_text 

Source
pub async fn get_latest_developer_message_text(
    conn: &mut PgConnection,
    conversation_id: Uuid,
) -> ModelResult<Option<String>>
Expand description

The text of the conversation’s newest developer message, which is where its page context is recorded.

Exists so the page context check does not have to materialize the whole conversation while the caller holds the conversation lock: get_by_conversation_id costs several queries per message, and every one of them is lock-held latency on the learner’s send.