Skip to content

(feat) Decide the single-batch recency rollup fallback and fix the flat-view total mismatch #5419

Description

@mmabrouk

Two loose ends and a product decision left over from the drive/mounts recency view.

Product decision needed: _rollup_recent_entries collapses a freshly-created directory (e.g. a just-cloned repo) into one folder row in the recency list. But it needs outside activity on at least one side to detect the batch boundary. A mount whose entire visible history is a single batch — the drive opened right after the motivating git clone — has no outside activity, so nothing rolls up at any level and the recency list floods with individual leaf files exactly in the scenario the feature was built for. The effect is cosmetic (the list is limit-capped), but it wants a decision on a single-batch fallback.

  • Decide whether the single-batch case should fall back to a synthesized top-level rollup, and implement the chosen behavior.

Cosmetics (verified present on the branch tip):

  • limit=0 is an undiscoverable count-only sentinel on GET /{mount_id}/files (count_only = limit == 0 and order is None). Give it a discoverable form or document it.
  • In the flat/recency view, total is computed as len(files) before the hidden-path filter runs, while the returned list excludes hidden entries — so the count badge and the visible list disagree by the number of hidden/dotfile entries. Compute total over the same set that is returned, or define the field's meaning explicitly.

Follow-up from the #5400 backend review. Cited findings: 3.3 (the rollup heuristic fails its own motivating single-batch case; the single-batch fallback is a product call) and the flat-view total / count-only sentinel cosmetics noted in 2.2 / 4.8. (The earlier next_cursor-vs-cursor naming point is dropped — the paged listing it referred to was removed from the branch.) The review report is not in the repo, so this summary stands alone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BackendQuestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions