fix: multiple timestamp_granularities collapse to last value in audio endpoint
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
Start in reference-server/src/routes/audio.ts at the multipart field handling that currently overwrites repeated names. Add or update the audio endpoint test with granularities: ['word', 'segment'], then verify the response contains both words and segments arrays.
Written by the indexing model from the issue text.
Description
Problem
In reference-server/src/routes/audio.ts, non-file multipart parts are stored as:
fields[part.fieldname] = { value: part.value };
This overwrites on repeated field names — last value wins. When the SDK sends timestamp_granularities as repeated form fields (e.g. ['word', 'segment']), only 'segment' is preserved.
Reported in PR #149 review.
Fix
Accumulate repeated fields into an array instead of overwriting. For example:
if (fields[part.fieldname]) {
// Convert to array or push to existing array
const existing = fields[part.fieldname];
if (Array.isArray(existing)) {
existing.push(part.value);
} else {
fields[part.fieldname] = [existing, part.value];
}
} else {
fields[part.fieldname] = { value: part.value };
}
Tests Needed
- Add a test passing
granularities: ['word', 'segment']and assert bothwordsandsegmentsarrays are present in the response.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 5
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mieweb/ozwellai-api
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
mieweb/ozwellai-api#285 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mieweb/ozwellai-api#284 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
mieweb/ozwellai-api#280 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mieweb/ozwellai-api#209 ·
-
mieweb/ozwellai-api#287 · 3 comments · 1 assignee ·
All issues in mieweb/ozwellai-api
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100