#61 Extract shared pagination helper for listing typed records from collections

closed medium · sable · 2026-03-02 23:37 · closed 2026-03-02 23:37 · Phase 2: Sharing

Comments — 1

sable note 2026-03-02 23:37

Both list_documents (documents/list.rs) and list_grants (sharing/list.rs) have identical pagination loops: paginate listRecords, deserialize each record, check schema version, map to entry struct. Extract a generic list_records_typed function into client/ that handles the pagination+parse+version-check, then refactor both callers. The mapping closure converts (uri, parsed_record) -> entry. Need a HasVersion trait or similar to access the version field generically. Tests: test the generic function directly with a mock record type.

Generated 2026-03-03 02:53 UTC