( sessionId: string, url: string, )
| 215 | * Get all session logs for hydration |
| 216 | */ |
| 217 | export async function getSessionLogs( |
| 218 | sessionId: string, |
| 219 | url: string, |
| 220 | ): Promise<Entry[] | null> { |
| 221 | const sessionToken = getSessionIngressAuthToken() |
| 222 | if (!sessionToken) { |
| 223 | logForDebugging('No session token available for fetching session logs') |
| 224 | logForDiagnosticsNoPII('error', 'session_get_fail_no_token') |
| 225 | return null |
| 226 | } |
| 227 | |
| 228 | const headers = { Authorization: `Bearer ${sessionToken}` } |
| 229 | const logs = await fetchSessionLogsFromUrl(sessionId, url, headers) |
| 230 | |
| 231 | if (logs && logs.length > 0) { |
| 232 | // Update our lastUuid to the last entry's UUID |
| 233 | const lastEntry = logs.at(-1) |
| 234 | if (lastEntry && 'uuid' in lastEntry && lastEntry.uuid) { |
| 235 | lastUuidMap.set(sessionId, lastEntry.uuid) |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | return logs |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Get all session logs for hydration via OAuth |
nothing calls this directly
no test coverage detected