Skip to content

Commit aeb3ead

Browse files
committed
fix(remote-config, other): return proper error for onConfigUpdated
previously was not a correctly formatted error object and not thrown simply returned - e2e test was probing it incorrectly so this slipped through despite a lot of attention!
1 parent c7391f0 commit aeb3ead

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/remote-config/e2e/config.e2e.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ describe('remoteConfig()', function () {
786786
const { getRemoteConfig, onConfigUpdated } = remoteConfigModular;
787787
try {
788788
onConfigUpdated(getRemoteConfig());
789+
throw new Error('Did not reject');
789790
} catch (error) {
790791
error.message.should.containEql(
791792
"'listenerOrObserver' expected a function or an object with 'next' function.",
@@ -804,7 +805,9 @@ describe('remoteConfig()', function () {
804805
const { getRemoteConfig, onConfigUpdated } = remoteConfigModular;
805806
try {
806807
onConfigUpdated(getRemoteConfig(), () => {});
808+
throw new Error('Did not reject');
807809
} catch (error) {
810+
error.code.should.equal('unsupported');
808811
error.message.should.containEql('Not supported by the Firebase Javascript SDK');
809812
}
810813
});

packages/remote-config/lib/web/RNFBConfigModule.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ export default {
122122
});
123123
},
124124
onConfigUpdated() {
125-
return getWebError('unsupported', 'Not supported by the Firebase Javascript SDK.');
125+
throw getWebError({
126+
code: 'unsupported',
127+
message: 'Not supported by the Firebase Javascript SDK.',
128+
});
126129
},
127130
};

0 commit comments

Comments
 (0)