Firestore Raw Mode queries functionality ETA?

Hi,

I was wondering if there is a timeline for a fix for Firestore Raw Mode queries?
Even in the latest Self Hosted Retool build (3.114.3), you still can't do queries in Raw Mode, only GUI Mode. It returns the error "Error in sandbox evaluation".

I have another issue where I wanted to list my Firebase Auth Users but in my tenant, linked here (Can't select Auth Tenant when listing users in Firebase Auth (Self Hosted))
If it was possible to do raw mode queries I would be able to list the users in the tenant myself, so can anyone answer if raw mode queries are going to be fixed any time soon?

Thanks very much

1 Like

I wasn't aware of this. We recently decided not to use self hosted for now. had we done it we would have faced this as we are using Firebase and use the Raw mode quiet often. I would love to see Retool sort this out.
+1

Hi @serena and @Amir1 .
The latest stable version allows for raw mode in Firestore: 3.148.2-stable
:grinning:

1 Like

Thank you, I have just updated to the new version 3.148.2 and tried it out.

I have 2 Firebase raw mode queries, they are both updating a document and are fairly similar, triggered by a script when I change data in a table and click save. Strangely, one of the update queries is successful and the other fails with "Error with sandbox evaluation". So I don't think this is completely fixed, and I don't know how to get any more information about what is wrong?

Secondly, my raw mode query for listing users in my firebase auth tenant doesn't fail with the error anymore, but now returns nothing. Both the db.auth() object (which would normally list my users in the main environment) and the auth.tenantManager().authForTenant() object return nothing when I call listUsers on them. So I think there is something wrong here too. I have tried the same code in Retool in the cloud and it works, but the code in the Self Hosted Retool latest version does not.

Can you help with any of these issues?

Thank you,
Serena

@serena,
Can you provide the code for the specific queries you are making? Thanks!

Apologies for the delay, I found the problem and I can confirm that Firebase Raw Mode queries are in fact working in that latest build!

The issue with listing Firebase Auth users was just my fault incorrectly setting up the configuration/permissions on the resource, the raw mode query does allow me to list users in my tenant.

The other problem with a raw mode query I was having, I managed to trace down to the following lines of code:

for (let i = 0; i < document_changes.statusUpdated.length; i++) {
    document_changes.statusUpdated[i].statusDate = firestore.Timestamp.fromDate(new Date(document_changes.statusUpdated[i].statusDate));
}

If the field "statusUpdated" does not exist on the database record, when running this code it would return the error "Error with sandbox evaluation". (In my case sometimes documents have this field omitted).

Once I modified the code to add this within an if statement which first checked for the existence of the field, the error went away and so everything is working now.

Thank you very much for implementing that feature in Self Hosted Retool!

regards, Serena

@serena, so glad to hear you are unblocked!