appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: Firestore connection configuration works wrong

Open gring2 opened this issue 1 year ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

When i try to connect to firestore's non-default database, appsmith keep connecting to default database. because it seems not to use url options, I tested with wrong database url and appsmith success to connect to default firestore db.

I expect to connect to db which's database url pointing (https://DATABASE_NAME.firebaseio.com). https://firebase.google.com/docs/database/web/start

스크린샷 2024-12-12 오후 3 19 32

I think bug is in here. FirestorePlugin try to access to default firestore first. it should give using options priority

.map(options -> {
    try {
        return FirebaseApp.getInstance(projectId);
    } catch (IllegalStateException e) {
        return FirebaseApp.initializeApp(options, projectId);
    }
})

https://github.com/appsmithorg/appsmith/blob/release/app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/plugins/FirestorePlugin.java

Steps To Reproduce

  1. Go to data.
  2. choose firestore
  3. try to connect to firestore with wrong database url.
  4. click test configuration
  5. successfully connects.
  6. put non default db url. in database url input.
  7. click test configuration
  8. still connects to default db

Public Sample App

No response

Environment

Production

Severity

High (Blocker to building or releasing)

Issue video log

No response

Version

self hosted - 1.5.2

gring2 avatar Dec 12 '24 06:12 gring2

is this issue open to contribution? I would like to take on this issue

HardikRathod123 avatar Dec 15 '24 07:12 HardikRathod123

Hi @HardikRathod123 yes this is open for contribution, you can check it out and let me know the approach for fixing this issue. During my research, I have found a couple of pointers that could be helpful for you:

  1. When we create firestore database, it creates a default database with free plan but for this issue, we would need upgraded plan in order to create non default database and test it
  2. This is the documentation for firestore java SDK https://firebaseopensource.com/projects/firebase/firebase-admin-java/

sneha122 avatar Dec 16 '24 09:12 sneha122

hello team , i would like to contribute to this ,is this issue still open for contribution ?

sakshamsingh7 avatar Jan 11 '25 12:01 sakshamsingh7

Hi @Nikhil-Nandagopal, @sneha122 , @carinanfonseca

I came across this issue and saw that it's labeled "Inviting Contribution". I'm a new contributor and excited to start contributing to Appsmith!

Could you please confirm if this issue is still open and if I can work on it?

Also, if you have any open backend/server-side issues that need contributions, I’d love to help! Please let me know if there’s anything suitable for me to work on. @contributor-support

Looking forward to your guidance. Thanks! 😊

AnweshPeddineni avatar Mar 02 '25 20:03 AnweshPeddineni

Hi @AnweshPeddineni Thanks a lot for your interest in working on this! The issue is still open as per my knowledge, please check once on your end as well. If it still exists, you can go ahead and pick this up!

sneha122 avatar Mar 05 '25 09:03 sneha122

Hey @Nikhil-Nandagopal @sneha122 I want to work on this issue.

YaxPrajapti avatar Jun 10 '25 17:06 YaxPrajapti

Please go ahead @YaxPrajapti

vivek-appsmith avatar Jun 13 '25 06:06 vivek-appsmith

https://github.com/appsmithorg/appsmith/pull/41067 I made PR about This Issue.

gring2 avatar Jul 19 '25 14:07 gring2