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
Allow emulators to work offline (MOTD fail) #4998
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a CHANGELOG entry that says:
- Catches errors when fetching CLI MOTD, allowing process to continue.
Added it to the latest changes. |
Accidentally closed the pull request. |
Re-ran local tests and a sample of commands (emulator and otherwise). They seem to all either proceed (e.g. emulators unless the .tar has not been downloaded yet) or exit gracefully when offline (e.g. functions:* commands). |
* Allow emulators to work offline (MOTD fail) * Allow process to continue when MOTD fetch fails * Run prettier on CHANGELOG.md Co-authored-by: Bryan Kendall <bkend@google.com>
Happy to work on the design/messaging as this is occasionally blocking development due to power outages here in Puerto Rico.
Description
This change improve the offline experience for the CLI and unblocks usage of the emulator while offline.
As seen in bug #3916 when offline for more than a day since the last CLI usage, the CLI will attempt to download a MOTD from (https://firebase-public.firebaseio.com/cli.json). If it fails, it just shows an error about failing to fetch the URL.
With this change in the case of
emulators:*
commands the CLI will print a warning, but continue the execution. In the case of other commands it will print a more descriptive message (see sample outputs below).Scenarios Tested
Tested running different commands both while online and while offline.
Sample Commands
firebase emulators:start --only auth,functions,firestore
Before:
After: (new second emulators warning)
firebase login
Before:
After: (new error that explains how to get past the error)