Skip to content

feat: Stream paginated list responses via iter_async#1885

Merged
gtema merged 1 commit into
mainfrom
codegenerator_998610
Jul 24, 2026
Merged

feat: Stream paginated list responses via iter_async#1885
gtema merged 1 commit into
mainfrom
codegenerator_998610

Conversation

@gtema

@gtema gtema commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Generated list handlers eagerly collected the full result set with
paged(ep, Pagination::All).query_async() before sending a single
Action::ApiResponsesData, so the TUI table stayed empty until every
page was fetched. Paged::iter_async already exists for streaming
consumption; wire generated list handlers to it instead, flushing
the cumulative Vec every 50 items plus a final flush so table
updates land incrementally without thrashing resort/scrollbar
rebuild on every row.

Also drops import/clone regressions introduced along the way:

  • api::QueryAsync only imported for non-paginated-list ops, since
    paginated list no longer calls .query_async() directly
  • serde_json::Value import dropped; generated code always
    fully-qualifies it, so the bare import was dead
  • eyre macro import now conditional on the file actually emitting
    an enum TryFrom impl (the only call site)
  • set_request_data_from_input no longer clones Copy primitives
    (bool/int) under by_ref=True; dereferences like the non-by_ref
    path instead, fixing clippy::clone_on_copy
  • Display impl's let mut parts only gets mut when the struct
    actually has an id/name param pair to push, fixing an
    unused_mut warning on resources without one

Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/998610
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com

Generated list handlers eagerly collected the full result set with
paged(ep, Pagination::All).query_async() before sending a single
Action::ApiResponsesData, so the TUI table stayed empty until every
page was fetched. Paged<E>::iter_async already exists for streaming
consumption; wire generated list handlers to it instead, flushing
the cumulative Vec every 50 items plus a final flush so table
updates land incrementally without thrashing resort/scrollbar
rebuild on every row.

Also drops import/clone regressions introduced along the way:
- api::QueryAsync only imported for non-paginated-list ops, since
  paginated list no longer calls .query_async() directly
- serde_json::Value import dropped; generated code always
  fully-qualifies it, so the bare import was dead
- eyre macro import now conditional on the file actually emitting
  an enum TryFrom<String> impl (the only call site)
- set_request_data_from_input no longer clones Copy primitives
  (bool/int) under by_ref=True; dereferences like the non-by_ref
  path instead, fixing clippy::clone_on_copy
- Display impl's `let mut parts` only gets `mut` when the struct
  actually has an id/name param pair to push, fixing an
  unused_mut warning on resources without one

Changes are triggered by https://review.opendev.org/c/openstack/codegenerator/+/998610
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
@gtema
gtema merged commit 459f1a1 into main Jul 24, 2026
18 of 19 checks passed
@gtema-release-plz gtema-release-plz Bot mentioned this pull request Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant