Hi, first of all thanks Backendless is a really cool tool and I have enjoyed using it so far.
I am currently have a frontend page on backendless that has a Data Table UI component that lists a couple of files the user has access to and I am struggling with real time update
The way it works is that I have a local script running that uploads a file to the backendless cloud. An event handler is adding the file name to a table whenever it is uploaded. This Table is then displayed in the data table UI component. When I have real time updates enables and lets say delete a file manually that change is instantly visible in the UI component, but it does not work when the event handler is adding the new entry. The file does appear when the UI component refreshes, by lets say sorting the entries.
This seems like a bug of the table not refreshing when an entry is added via script. I tried to work around it by refreshing the page (could not figure out how to do that properly). Is there any work around to this? Could this be caused sine I am testing this in preview mode?
Any help is greatly appreciated and thanks in Advance
Hi @Nick_Bachsoliani !
Could you please provide your App ID?
I have tried to recreate your problem in test app but was unable to succeed - in my case there were no problems with RT events. I seems like a problem can be related to the specific app.
Regards, Andriy
Hey, thanks for looking into this.
7186C53B-6DC7-A94B-FF01-314AED34FD00 is my app id, the bug happens on the page called Landing
I use a python code to upload the file and as I mentioned the even handler correctly adds the relevant new table entry, but the data table does not auto refresh when that happens.
I also added a refresh button now as a workaround which takes you to a blank page and returns you after one second. The end result would be that the user requests a report from a python API and it shows up once the code uploads it to the server. It works, but it would be best if I did not have a hacky solution with an arbitrary wait time.
Best regards,
Nick
Hello @Nick_Bachsoliani,
I’ve just tried to check RT in your app and everything worked fine. Unfortunately, I cannot check with Python, but I’ve checked creating/updating/deleting a new record in the filetable
Table using REST and Swift and everything works fine for me.
Is issue still occurs for you?
Regards,
Olha
Hi @olhadanylova,
hmm, did you logged in with the test user info I have defined and check on the published page? When a file is uploaded to the folder path excelfiles/KKKKKKKK the event handler adds an entry to the filetable database. This entry is then supposed to show up in the frontend datatable for the logged in user, but it is not at least not for me.The event handler is working as intended so I don’t think there is an issue with python since it not actually updating the data table.
I did some more testing on multiple browsers and noticed that it correctly updates when I am kicked out of the session. So when I log with my test user it does not update, but when I then log in with another browser or another device with the same user it starts updating the table dynamically in the now timed out session. In my table content I have where clause that checks the current users company and loads his information. So technically when the user times out it should not be loading it anymore, but the behavior seems to opposite of what I expect
Hi @Nick_Bachsoliani,
I checked that in the published application, the table is really not updated, unlike the table in the Preview mode. Is it possible that you have made changes that have not yet been published? Have you tried publishing the latest version of your app and checking this issue afterwards?
Regards,
Stanislaw
Hey @stanislaw.grin,
sorry for the late reply I did push the latest changes, but the issue remains for me. When the user on the page is authenticated then nothing updates. But if the user timed out the list updates perfectly. I do have some logic on page enter which checks if it is a valid user session otherwise it returns you to log in. Not sure if that has an effect.
Best,
Nick
Little update from my side,
the delete part of the event handler is being recognized in the table update. When there are more then 10 files it deletes the oldest file and the table entry, this works as intended and the change shows up in the frontend data table. Before this deletion the creation of the new entry happens in the same event handler. I was hoping when the table updates due to the deletion it would also show the newest items, but that is not the case.
I also tried to replace the “Save Object in Backendless” code block with “Deep Save” and “Bulk create” I also added a bulk update for a dummy column just in case that could help but in neither case was a new entry to the data table registered in real time.
Is there any other way of displaying data in a list if this does not work?
Best regards,
Nick
Another Update,
I created a new file table and used that, which seems to have resolved the issue. It is weird though since the tables are virtually identical.
Best regards,
Nick