listSessionSegmentPaths function

Future<List<String>> listSessionSegmentPaths(
  1. FileSystem fs,
  2. String primaryPath
)

All segment paths of a (possibly rotated) session in chain order: the .part-NN siblings, oldest first, then the primary. A listing failure degrades to just the primary — raw-scan consumers (readCustomRecordsOfType, sessionNameQuick) must never fail a boot because housekeeping metadata could not be read.

Implementation

Future<List<String>> listSessionSegmentPaths(
  FileSystem fs,
  String primaryPath,
) async {
  final listed = await JsonlSessionStorage._listSessionParts(fs, primaryPath);
  return [...?listed?.parts, primaryPath];
}