-
Notifications
You must be signed in to change notification settings - Fork 950
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
Storage emulator custom metadata clear via setting null returns string 'null' for property #3385
Comments
@mikehardy thanks for reporting! Sounds like a bug to me. |
I can chunk these out into different issues but I have a little batch of others as well. What's confusing about this little batch I mention just in this comment is that these are platform-specific, they fail when going through firebase-ios-sdk but not with going through firebase-android-sdk. I'm not sure how to track that down but you folks may have insight? The FIXMEs here: describe('updateMetadata', function () {
it('should return the updated metadata for a file', async function () {
const storageReference = firebase.storage().ref(WRITE_ONLY_NAME);
const metadata = await storageReference.updateMetadata({
contentType: 'image/jpeg',
cacheControl: 'true',
contentDisposition: 'disposed',
contentEncoding: 'encoded',
contentLanguage: 'martian',
customMetadata: {
hello: 'world',
},
});
metadata.customMetadata.hello.should.equal('world');
metadata.generation.should.be.a.String();
metadata.fullPath.should.equal(WRITE_ONLY_NAME);
metadata.name.should.equal(WRITE_ONLY_NAME);
metadata.size.should.be.a.Number();
should.equal(metadata.size > 0, true);
metadata.updated.should.be.a.String();
metadata.timeCreated.should.be.a.String();
metadata.contentEncoding.should.be.a.String();
metadata.contentDisposition.should.be.a.String();
if (device.getPlatform() === 'android') {
// FIXME on iOS this is 'application/octet-stream'?
metadata.contentType.should.equal('image/jpeg');
}
metadata.bucket.should.equal(`${firebase.app().options.projectId}.appspot.com`);
metadata.metageneration.should.be.a.String();
metadata.md5Hash.should.be.a.String();
if (device.getPlatform() === 'android') {
// FIXME on iOS this comes back null ?
should.equal(metadata.cacheControl, 'true');
}
if (device.getPlatform() === 'android') {
// FIXME on iOS this comes back null ?
should.equal(metadata.contentLanguage, 'martian');
}
metadata.customMetadata.should.be.an.Object();
}); Also this one describe('getMetadata', function () {
it('should return a metadata for a file', async function () {
const storageReference = firebase.storage().ref(`${PATH}/list/file1.txt`);
const metadata = await storageReference.getMetadata();
metadata.generation.should.be.a.String();
metadata.fullPath.should.equal(`${PATH}/list/file1.txt`);
if (device.getPlatform() === 'android') {
// FIXME - iOS on emulator this is fullPath not name ?
metadata.name.should.equal('file1.txt');
} If the emulator was at fault I would expect cross-platform behavior but these ones are platform-specific. Happy to help chase these down just not sure if they need to go here or in the SDK repos for ios / android |
@abeisgoat has mentioned that there are many strange things about the iOS SDK ... so he will know what to do with these bugs. |
Please file the iOS specific stuff as a new bug :) Re the deleting metadata with |
[REQUIRED] Environment info
Hi there!
firebase-tools: 9.11.0
Platform: macOS 11.3.1
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
customMetadata.removeMe
should be undefined in javascript terms at that point?[REQUIRED] Actual behavior
customMetadata.removeMe
is the stringnull
:here's a paste of that console.error statement:
I'll try to put a commit hash in later once my storage emulator work is public
The text was updated successfully, but these errors were encountered: