GetTagList does not seem to work

Yes indeed - can you go through all points mentioned Ignacio (you are the OP).

TimAI2 has some excellent material on Firebase:
https://sites.google.com/view/metricrat-ai2/guides/how-to-have-secure-rules-on-firebase-and-allow-auth-users-to-readwrite?authuser=0

I am sorry I have not been answering, I have been following the discussion but I can not add much honestly; I am quite lost. Regarding what ABG asked:

  • Did the OP lock down his database in its security rules so much that it returns nothing?

I modified the rules when I created the projects, but they are only defined as public. Here you have a screenshot:

image

I know this is completely unsafe, but it is just a database for a school project and it made my work easier.

  • Did the OP annoy Google by hitting on his database so much that Google won't answer his requests for a while?

I do not think that is the case if I am honest, because I am only having problems retrieving those tags. I can get the values for those keys using a Get Value, it is just that particular block of code that does not seem to work.

  • Is the database just empty?

It definitely is not. I posted a screenshot earlier with its content, and, as I said, I can retrieve that data.

Another tip is to keep your code Blocks tidy and logically arranged - it's very difficult to follow your code.

I will definitely address this, I am just very new to this tool and I am still getting use to using blocks instead of code. I appreciate the feedback and the time you're spending on helping me, I really do!

.... we can all see you have got a long way in a short time, so it's interesting to try to find the bugs with you.

1 Like

Here's another straw to grab at ...

  • There's a Firebase block, Unauthenticate. I vaguely remember it being the solution to problems involving interactions between multiple connections on multiple buckets across multiple screens, like this project has. (I haven't found the original thread and reference yet.)

Unauthenticate()

Unauthenticate from Firebase.

Firebase keeps track of credentials in a cache in shared_prefs It will re-use these credentials as long as they are valid. Given That we retrieve a FirebaseToken with a version long life, this will effectively be forever. Shared_prefs survive an application update and depending on how backup is configured on a device, it might survive an application removal and reinstallation.

Normally this is not a problem, however if we change the credentials used, for example the App author is switching from one Firebase account to another, or invalided their firebase.secret, this cached credential is invalid, but will continue to be used, which results in errors.

This function permits us to unauthenticate, which tosses the cached credentials. The next time authentication is needed we will use our current FirebaseToken and get fresh credentials.

1 Like

I will make sure to check this and to try using a timer as Chris Ward suggested as soon as I can. I will keep you updated on that!

Perhaps something has recently changed in FireBase or App Inventor that results in GetTagList failing. I think now is the time to ask Evan if we are barking up the wrong tree.

Firebase GetTagList will not fire if the tag is empty....

I think that has been explored by Ignacio, we have said that a tag name typo could also be the cause.

Here's a wild coincidence ...


This Firebase user suggested a Taglist starting with the number 1 would not work.
This database fits that description.

1 Like

Yes, I was just about to say that, having run a test. Change 1:, 2:, 3:, in productos to 01:,02:, 03:, and you will find that getTagList suddenly works

1 Like

I had inserted a tag 0, but it did not help.

Nope, I can get individual tags, but my TagList event sits there like a lox.

um you are sending 01 as a number which would end up being 1, send 01 as text ?

image

Output:

["a","b","c"]

I am working in the OP database.
Adding a text tag ("ABG")

restored functionality to the Taglist operation.

I never cared for integer tags in Firebase.
In this app, the name concatenated with an optional numeric de-duplicator should have been the tag.

(added to FAQ)

item 2

It works OK if Firebase itself adds integers starting from 1 in its data structure, but not from the firebase component for some strange reason....

It worked indeed, I can use the Taglist operation now that you added that text tag. I think I can mark ABG's answer as the solution for this topic, if you all agree. This has all been extremely helpful, and I think I may be able to continue my work now. I am so thankful!

1 Like

Very well spotted ABG and TimAI2 :dart:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.