Skip to content

Conversation

@jmwski
Copy link
Contributor

@jmwski jmwski commented Mar 17, 2021

Description

Fixes #3228

The namespace server expects string-value .settings/<setting>.json values to be quoted. For defaultWriteSizeLimit, this meant that passing unlimited broke with this error log in firebase-debug.log:

[debug] [2021-03-17T22:10:45.519Z] <<< [apiv2][body] PUT https://fir-multi-shards.firebaseio.com/.settings/defaultWriteSizeLimit.json {"error":"defaultWriteSizeLimit should be one of {\"small\", \"unlimited\", \"large\", \"medium\"}"} [debug] [2021-03-17T22:10:45.636Z] FirebaseError: HTTP Error: 400, defaultWriteSizeLimit should be one of {"small", "unlimited", "large", "medium"} at module.exports (/usr/local/google/home/wyszynski/.nvm/versions/node/v10.15.3/lib/node_modules/firebase-tools/lib/responseToError.js:38:12) at Client.doRequest (/usr/local/google/home/wyszynski/.nvm/versions/node/v10.15.3/lib/node_modules/firebase-tools/lib/apiv2.js:238:23) at process._tickCallback (internal/process/next_tick.js:68:7) [error] 

Sample Commands

I tried setting the two supported database settings:

node ./lib/bin/firebase.js --project fir-multi-shards database:settings:set strictTriggerValidation false --instance fir-multi-shards 

And:

node ./lib/bin/firebase.js --project fir-multi-shards database:settings:set defaultWriteSizeLimit unlimited --instance fir-multi-shards 

And they both set the setting to the appropriate value. This change should also be robust to setting rules from the CLI.

@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label Mar 17, 2021
@jmwski jmwski requested a review from bkendall March 17, 2021 23:07
@fredzqm
Copy link
Contributor

fredzqm commented Mar 17, 2021

Oh, maybe update the CHANGE_LOG.md

Copy link
Contributor

@bkendall bkendall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment on the changelog, but looks fine otherwise

@jmwski jmwski merged commit 1826400 into master Mar 24, 2021
@jmwski jmwski deleted the jw/database-settings-set-fix branch March 24, 2021 16:18
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
* Add missing JSON.stringify in database:settings:set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

4 participants