Firebase Not Retrieving TagList

I am making an app that uses the experimental, "Firebase" database and I am having some trouble with my code. I first found this issue when I was calling the .TagList through a procedure (it has the same effect if it is outside of a procedure block.)

I stored the current date in a firebase tag I named, "latestDate" and the variable I stored is from a sensor which I have plugged into a global variable in which I named, "currentDate". The currentDate holds the following:

.Month > System.Time,
.DayOfMonth > System.Time,
and .Year > System.Time

Putting the time in a MM/DD/YY format.

Time Jump:

I started to write this at 11:00 and decided to go back and see if I could figure it out and I did..

when I update the time I am hitting a submit button that is named, "sendDateUpdate" which is connected to a .StoreValue, the tag I am storing is named, "latestDate" and the value I am storing is named, "currentDate".

I have the data already up in firebase but I can't get the data unless I update or change the value and I am just looking for a way to get the date that is stored in the firebase without changing anything in the firebase. Is that possible? My goal is to be able to open the app, have the app automatically pull the data down but the way it is right now the only way I can pull the data down is by editing, adding to, and/or changing the data.

I put down a ".Initalize" and added the .TagList to that though it completely skipped the .GotValue and never actually tried to get anything from the firebase.

Please download and post each of those event block(s)/procedures here ...
(sample video)


Please export your project and post it here.

Here is the exported aia file

Giveaways_Screen_checkpoint1.aia (51.9 KB) Giveaways_Screen_checkpoint1.aia (51.9 KB)

oof, it posted twice

Here are the relevant blocks from your app ...


retrieveLatestDateData

(It would have speeded up things for you if you had done this.)

Your refresh button calls two procedures in quick succession.
The second depends on the results of the first having hit the database, not immediately true.

retrieveLatestDateData

I recommend you add some error capture:
when firebase error
with a Notifier call in it.

Why do you need three Clocks for different parts of a date?
A single Clock would do for that.

This Clock Timer block is wildly redundant:


The contents would not run if the Timer is enabled, so it is equivalent to
when DeviceOnlineChecker Timer

Your Screen2.Initialize

reads a global variable that has not yet had an opportunity to have been set by the arrival of FireBase .GotData events that set it.

Remove those blocks, and leave them for the GotData event.

You should not need to use the taglists, especially since you never even use the result.

Further thoughts ...

You might be having trouble distinguishing between the current date and what Firebase has last been told is the current date.
Clock1.Now() will give you the current date.

Well, the reason why I use multiple sensors is so that I can be better organized and it helps with debugging. Also the clock timer that is wildly redundant that's how my school taught me to do things haha! Also, the firebase has data stored inside of it I don't understand why it's not retrieving it image

I see you changing your project bucket from its Designer value in this procedure ...
ProjectBucket

Where in your code does this new bucket come into existence in the Firebase DB?

What do you see in your Firebase data console?
Show us.

How do you expect the tag list results to change if you change your bucket?

What would happen if you change your bucket to a nonexistent bucket and you don't have error trapping and reporting?

How would you expect your refresh button click event to fire if the button is disabled?
So why test for that?

Here is an example of the Firebase console showing the data in one of my test projects.
Show us yours.

I added the project bucket to the code so that I can easily access it as a tag. Once I start the app and press either Submit or Refresh the date would be saved to the database and if I went into the database and manually entered something else where the date value is and then pressed the button the manual date would be overwritten instead of making a new input. Also, the refresh button holds no purpose aside from an idea I had for debugging. (Also sorry for the late reply lol, i'm currently at work)

That date is already stored in the database, it's just when I try to retrieve it from the database it completely skips over the .GetTagList, the only time it does not skip over is if I send the data to the database even if it's the same data that's already there. What i'm trying to do is i'm trying to get the data back without having to edit the database everytime I launch the app

Here's an example.

Let's say that 10/12/2020 is already in the database, I press the Submit button to change the value in the database. If 10/12/2020 is in the database and I want to get that value from the database I will then have to hit the submit button and only then will it read into it. It's like i'm just saying to the database, "Hey, even though it's already here I want you to act like this value is a new value and send it back to me". What I want to happen is for the app to automatically say, "Hey, you got this value?" and the database says, "Sure, here you go!" without the app having to make any changes to the database even if it's not a visual change like changing the value from "10/12/2020" to "10/12/2020"

It makes sense to me but let me know if you're confused, I have a bad way for explaining things haha

I have a way for the app to get the value automatically that's through the .Initialize and .GetTagList but it completely skips over the .GetTagList if the app screen has either been refresh or if I open the app after having it been closed and have not made any changes to the database.

I changed the name of the database to "automaticDataInput" and called the .GetTagList and yes, I have 3 sensors but that's how I keep myself organized and I use all of them to debug different things if issues seem to arise

image

When I get off of work I will take a video of what is happening for a visual explanation

Your bucket name looks problematic for Firebase, because of its embedded space:

(Correction by @TimAI2 - My search landed in the wrong bucket. - ABG)

https://cloud.google.com/storage/docs/naming-buckets

Bucket name requirements

Your bucket names must meet the following requirements:

  • Bucket names must contain only lowercase letters, numbers, dashes ( - ), underscores ( _ ), and dots ( . ). Spaces are not allowed. Names containing dots require verification.
  • Bucket names must start and end with a number or letter.
  • Bucket names must contain 3-63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.
  • Bucket names cannot be represented as an IP address in dotted-decimal notation (for example, 192.168.5.4).
  • Bucket names cannot begin with the "goog" prefix.
  • Bucket names cannot contain "google" or close misspellings, such as "g00gle".

Bucket name considerations

  • Bucket names reside in a single Cloud Storage namespace.This means that:
    • Every bucket name must be unique.
    • Bucket names are publicly visible.If you try to create a bucket with a name that already belongs to an existing bucket, Cloud Storage responds with an error message.
  • A bucket name can only be assigned during creation.You cannot change the name of an existing bucket. Instead, you should create a new bucket with the desired name and move the contents from the old bucket to the new bucket. See Moving and Renaming Buckets for a step-by-step guide.
  • Once you delete a bucket, anyone can reuse its name for a new bucket.The time it takes a deleted bucket's name to become available again is typically on the order of seconds; however, if you delete the project that contains the bucket, which effectively deletes the bucket as well, the bucket name may not be released for weeks or longer.
  • You can use a bucket name in a DNS record as part of a CNAME or A redirect.In order to do so, your bucket name should conform to standard DNS naming conventions. This means that your bucket name should not use underscores ( _ ) or have a period next to another period or dash. For example, ".." is not valid within DNS names and neither is "-." or ".-".

See also the Naming Best Practices section, which includes recommendations about excluding proprietary information from bucket names.

There are 2 considerations relevant to this:

  • Screens are separate tasks, and switching them forces reconnects to everything.
  • There is a persist flag in your Firebase attributes that wasn't set by you.
    Persist
    from Experimental
    Persist

If true, variables will retain their values when off-line and the App exits. Values will be uploaded to Firebase the next time the App is run while connected to the network. This is useful for applications which will gather data while not connected to the network. Note: AppendValue and RemoveFirst will not work correctly when off-line, they require a network connection.

Note : If you set Persist on any Firebase component, on any screen, it makes all Firebase components on all screens persistent. This is a limitation of the low level Firebase library. Also be aware that if you want to set persist to true, you should do so before connecting the Companion for incremental development.

Here is an inconsistency that needs investigating ...
bucket data Persist

Where is your ProjectBucket value of "Giveaways" used in your data content?

I completely stopped the ai companion app that I have on my phone and I made sure that the "persist" option was checked.

When I refresh my screen the "latestGiveawayLabel" will be set to "Latest Giveaway: ". I put the "retrieveLatestDateData" procedure at the start when the with the screen2 .Initalize and the "latestGiveawayLabel" is supposed to get the date from the database. The app still does not do that even with the persist button checked.

(Database image below)image

When I call the "retrieveLatestDateData" that holds the .GetTagList, the .TagList does nothing, it only works when I make any changes to the database even if the persist button is checked.