Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Empty waveform peaks data renders an empty waveform; should render placeholder instead. #1074

Closed
1 task
sarayourfriend opened this issue Mar 8, 2022 · 2 comments · Fixed by #1100
Closed
1 task
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP

Comments

@sarayourfriend
Copy link
Contributor

Description

The API returns an empty array when the waveform peaks have not been generated. The frontend currently assumes that any array returned will include waveform data. However, the frontend should also check the length of the array and use the placeholder if the peaks array is empty.

Alternatively we could update the API to return null for the peaks when they haven't been generated yet.

Marked as critical because we can't deploy without this fix or we'll have empty waveforms for most audio.

Resolution

  • 🙋 I would be interested in resolving this bug.
@sarayourfriend sarayourfriend added 🟥 priority: critical Must be addressed ASAP 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Mar 8, 2022
@dhruvkb
Copy link
Member

dhruvkb commented Mar 10, 2022

A good place to fix this would be in the decodeMediaData util that handles the conversion of API responses into media types that the frontend uses. We already wrangle the title, creator and tags fields there so extending it to peaks would not be too much of a leap.

@dhruvkb
Copy link
Member

dhruvkb commented Mar 11, 2022

On further thought, VWaveform can be extended to handle the peaks prop being [].

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟥 priority: critical Must be addressed ASAP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants