Skip to content

Standalone Action does not reload resources after triggering a download #4380

@pmarchi

Description

@pmarchi

Configuration

Avo version

4.0.0.beta.6

Rails version

8.1.3

Ruby version

4.0.1

License type
  • Community
  • Pro
  • Advanced
Are you using Avo monkey patches, overriding views or view components?
  • Yes — please post code samples below
  • No

Description

Calling download in Avo::BaseAction#handle does not reload the records after the file has been downloading. If the action created new records, they will not show up until interactively reloading the page using the browser reload butten.

Adding reload after download correctly reloads but does not trigger the download anymore.

Additional context

This happens in a standalone action, that creates new records of a recourse.

  def handle(query:, fields:, current_user:, resource:, **args)
...
    statement = Statements::GenerateMonthlyStatement.call(statement_data: statement_data)
    download statement.file.download, statement.file.filename
...
  end

Screenshots or screen recordings

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions