Post

Replies

Boosts

Views

Activity

Ghost Function - Automatic and Backdated Firebase Updates
Hi everyone, I am experiencing an issue that I wasn't able to identify its source after spending days in debugging and need some help / assistance. I have recently been to a local Apple Event dedicated to help and explain us how to use Instruments and Xcode Metrics tools, and also booked a Lab session with few of the Evangelists over there but the time wasn't enough for them to identify the root cause either. I have created a function that will lookup for all available jobs under one's account and toggle them between Private or Public based on the selection. Since I have ran and tested it I ended up with a continuous loop and update in Firebase of the jobs found that blocks the UI and freezes the app ( does not terminate it although ), in the following scenarios: When I reopen the app during the same logged session, the update is triggered but is backdated, so it will always update the field values for update and isPrivate fields to when was originally triggered, not in the present time. If I log out and login again it gets triggered again If I logout, remove the app completely and reinstall it the problem does not appear until I trigger again the toggle button from Privacy screen. This is where the settings sits. Profile Tab > Settings > Privacy. I have used all the available tools from Instruments to try to investigate the issue without any success, Profiler/SwiftUi etc... even disabled the func completely, uninstalled the app, reinstalled it, ran it again but the loop or however I can call it is still there, it still runs when I toggle the Privacy options button. For another account I have deleted the job from Firebase but in Xcode console I can see that something is calling the previous job id and trying to update the jobs for this account too, even if there are no more jobs documents in Firebase… The toggle button was working perfectly fine ( was changing only privacy settings per account ) before I have updated it with another func to change the jobs privacy too. I am puzzled on how come this update, which is related to an action of a button, gets triggered automatically when the app launches? Therefore, could someone please let me know if you have experienced something similar in the past and how did you solve it or how can I use the Instruments better than I am probably using them now to actually identify this ghost function ( hence I removed it completely from the code base and is still called ) that triggers this update ? Thank you
0
0
111
3w