From 91925fc9d86ed7e36ebeb9f848a9503d2c3895bf Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:12:17 -0700 Subject: [PATCH] unpaginate summart retrieval (#191) --- pkg/server/webhandlers/session_details.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/server/webhandlers/session_details.go b/pkg/server/webhandlers/session_details.go index 7ff7eacd..f3900ec5 100644 --- a/pkg/server/webhandlers/session_details.go +++ b/pkg/server/webhandlers/session_details.go @@ -82,14 +82,16 @@ func (m *SessionDetails) Get(ctx context.Context, appState *models.AppState) err return nil } - // pageSize needs to be >= MessageList page size so that we get all summaries related to the messages - // TODO: this may break under some circumstances. fix it. + // GetSummaryList returns a list of summaries for the given session. It can be + // paginated, but we are not using pagination to ensure that we retrieve all summaries for + // the messages we're displaying. + // Hacky solution: set the page offset to 0 and the limit to a large number summaries, err := m.MemoryStore.GetSummaryList( ctx, appState, m.SessionID, - m.CurrentPage, - m.PageSize, + 0, + 9999, ) if err != nil { return err