Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: force visualization fetch to ensure recording for offline #3196

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/Item/VisualizationItem/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ class Item extends Component {
await apiFetchVisualization(this.props.item)
)

// force fetch when recording to allow caching of the visualizations request
if (this.props.isRecording) {
apiFetchVisualization(this.props.item)
Copy link
Collaborator

@jenniferarnesen jenniferarnesen Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to await this request?

It does look a bit weird to have the same request 5 lines above.

Also, no chance that this request would get triggered twice?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to await because we are not using the returned value.
The other fetch above needs the returned value for setting it in the Redux store.

I don't think it can be triggered twice because the recording can only happen once the dashboard is loaded.
But this needs testing.

}

try {
if (
this.props.settings
Expand Down
Loading