ref(data-export): Extract helper methods from endpoint and assemble_download task#112617
Conversation
…ownload task
Break down the monolithic post() handler and assemble_download
task into focused private helpers to enable further refactoring
for new export functionality. Also introduce an AssembleChunkResult
NamedTuple and a Processor type alias to reduce repetition. No behavior change.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7e0623f. Configure here.
| *, | ||
| page_token: str | None = None, | ||
| last_emitted_item_id_hex: str | None = None, | ||
| run_sync: bool = False, |
There was a problem hiding this comment.
Unused run_sync parameter never read or propagated
Low Severity
The new run_sync parameter on assemble_download is never read within the function body and no caller passes it. Additionally, neither _schedule_retry nor _schedule_next_task propagates it when scheduling continuation tasks via apply_async, so even if a future caller sets run_sync=True, subsequent retries and continuations would silently revert to the default False. This is dead code that could mask a latent bug once the parameter is eventually wired up.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 7e0623f. Configure here.


Break down the monolithic post() handler and assemble_download
task into focused private helpers to enable further refactoring
for new export functionality. Also introduce an AssembleChunkResult
NamedTuple and a Processor type alias to reduce repetition. No behavior change.