Skip to content
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

fix: add underlyingException to FirebaseJsonException when projectId or appId are missing #364

Merged

Conversation

Leedwon
Copy link
Contributor

@Leedwon Leedwon commented Jan 16, 2025

Description

This is a follow up to #354. It improves the error message for misconfigured firebase.json file.

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the Needs Attention OP created or responded to issue and it needs attention. label Jan 16, 2025
@Leedwon
Copy link
Contributor Author

Leedwon commented Jan 16, 2025

Hi @russellwheatley, I’ve opened a PR for the small improvement we discussed in #354. While testing it locally in my Flutter app, I noticed the underlyingException != null ? '' : underlyingException condition seemed inverted, so I fixed it in a7b0a4f.

However, even with this fix, I couldn't see the exception when building my app. I followed the README and ran dart pub global activate --source="path" . --executable="flutterfire" --overwrite in my fork but still no luck. I also tried using dependency_overrides in my app without success. Could you point me in the right direction on how to properly use the local flutterfire_cli version in my project?

@@ -313,7 +313,10 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand {
}

if (projectId == null || appId == null) {
throw FirebaseJsonException();
final underlyingException =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was also thinking about adding a separate message for a case when both projectId and appId is missing, but I'm not sure if it's needed - worst case user will first see projectId is missing and then appId is missing

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think this works 😄

@Leedwon
Copy link
Contributor Author

Leedwon commented Jan 23, 2025

Hi @russellwheatley, any chance you could take a look 🙏?

@russellwheatley
Copy link
Member

@Leedwon - regarding local development; did you follow the local development instructions? https://github.com/invertase/flutterfire_cli#local-development-setup

Important to note that you need to delete the snapshot in .dart_tool/ directory otherwise it won't reflect the latest code changes. Not great to be honest. Now that I think about it, it might be worth creating a melos.yaml script that deletes the latest snapshot and then runs dart pub global activate --source="path" . --executable="flutterfire" --overwrite 🤔

I'm going to be some devving on FFCLI today so I might write that script later.

@@ -313,7 +313,10 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand {
}

if (projectId == null || appId == null) {
throw FirebaseJsonException();
final underlyingException =
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think this works 😄

@russellwheatley russellwheatley merged commit d1fab7e into invertase:main Jan 23, 2025
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention OP created or responded to issue and it needs attention.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants