Read one page of Duo Chat messages from the checkpoint

What does this MR do and why?

Adds a paged read of Duo Chat messages to getWorkflowLatestCheckpoint. Nothing calls it yet, so behavior doesn't change.

This is the first of three MRs split out of !266759 (merged), which lazy loads Duo Chat history behind duo_chat_lazy_load_messages. It uses the messages connection that !264039 (merged) added to DuoWorkflowEvent.

  • The query takes $paged (default false) and $before. With paged, it selects one messages(last: 50, before: $before) page and its pageInfo { startCursor hasPreviousPage } instead of duoMessages. The message fields move into a DuoMessageFields fragment that both selections use.
  • ApolloUtils.fetchWorkflowEvents and loadActiveWorkflowWithRetry accept paged (and before), and only send the new variables when paged is set.
  • readCheckpointMessages returns the messages from whichever selection was read, plus the cursor of the next older page (or null once the first message is reached).
Why four existing specs change

Apollo adds the query's declared default (paged: false) to the request variables. So message_tool_start_flow_spec.js and the reconnect spec in duo_agentic_chat_state_manager_spec.js now expect paged: false, and the two integration specs (conversation_lifecycle_spec.js and archived_thread_spec.js) check only the workflow id they care about (toMatchObject instead of toEqual).

References

Screenshots or screen recordings

Not applicable: no UI change.

How to set up and validate locally

No visible change: nothing passes paged: true until !266759 (merged). To check that the existing request is unchanged:

  1. Open a Duo Chat thread.
  2. In the browser network tab, check that the getWorkflowLatestCheckpoint request still selects duoMessages and returns the full history.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Tomas Bulva

Merge request reports

Loading
Loading