fix(weave): detect WAV from in-memory buffer when libmagic returns octet-stream - #7018
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=8d00576f550ebb3fbbb0836004dd7db2c2cb6c84 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
andrewtruong
approved these changes
Jun 1, 2026
rgao-coreweave
approved these changes
Jun 1, 2026
rgao-coreweave
left a comment
Contributor
There was a problem hiding this comment.
LGTM
does this need test? how do we test wave files?
zbirenbaum
force-pushed
the
zach/wav-buffer-detection
branch
from
June 2, 2026 20:30
3f6638c to
336cb5a
Compare
* feat(weave): use content for attached media * fix(weave): fix lint errors, update tests for audio/wav mimetype and 4-field MessageTuple * fix(weave): store message parts in content field, remove parts tuple field * lint * feat(weave): upload attach_media content on background threads (#7017) * feat(weave): upload attach_media content on background threads * chore(weave): re-trigger CI * fix string typing
zbirenbaum
force-pushed
the
zach/wav-buffer-detection
branch
from
June 3, 2026 19:09
336cb5a to
3be5be0
Compare
zbirenbaum
enabled auto-merge (squash)
June 3, 2026 19:10
zbirenbaum
disabled auto-merge
June 3, 2026 19:19
* chore(weave): normalize wav mimetypes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes: WB-35004
Some
libmagicbuilds cannot identify a WAV file when classifying it from an in-memory bufferReturns
application/octet-stream, even thoughmagic.from_fileon the identical bytes correctly returnsaudio/x-wav.Because
Contentfrequently detects from buffers, WAV (and Content by extension) detection behaves inconsistentlyPR fixes inconsistency by checking the RIFF & WAVE magic bytes directly when
from_bufferreturns nothing or the generic octet-stream typeTesting
Made sure existing tests pass, this fixes failing tests in other branches