Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DashboardView no events on 1st load #238

Closed

Conversation

hanhqvu
Copy link
Contributor

@hanhqvu hanhqvu commented Oct 28, 2023

What it Does

How I Tested

  • Build then run the app in the simulator

Notes

  • I'm not entirely sure if this is best practice

Screenshot

RocketSim_Recording_iPhone_15_2023-10-28_22 18 34

@hanhqvu hanhqvu requested a review from mikaelacaron as a code owner October 28, 2023 13:22
Copy link
Owner

@mikaelacaron mikaelacaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanhqvu No I would not solve it this way, is this not being called properly in the .task?

Also the code you removed from the makeAddMaintenanceView function will cause a bug, why is this removed?

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 29, 2023

@mikaelacaron I added breakpoints to .task and it is not called when DashboardView appear on 1st load. If switch tabs then it got called. Regarding the removed code, I think the bug is tied to .task not being called so not getting vehicles.

@mikaelacaron
Copy link
Owner

mikaelacaron commented Oct 29, 2023

Regarding the removed code, I think the bug is tied to .task not being called so not getting vehicles.

No the point of line 149 to 151

is to recall the events again after an event has been added, to update the list

I added breakpoints to .task and it is not called when DashboardView appear on 1st load.

I totally thought it should be, could you find documentation behind this why it's not called when the view first appears?

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 29, 2023

Regarding the removed code, I think the bug is tied to .task not being called so not getting vehicles.

No the point of line 149 to 151

is to recall the events again after an event has been added, to update the list

I added breakpoints to .task and it is not called when DashboardView appear on 1st load.

I totally thought it should be, could you find documentation behind this why it's not called when the view first appears?

Ah, I see. My bad on that, I'll revert that.

Also another point, could be because I'm not familiar with Firebase but why does the events get cleared out of memory when the app goes into background. The events should still be in memory if the app is still in memory right?

@mikaelacaron
Copy link
Owner

could be because I'm not familiar with Firebase but why does the events get cleared out of memory when the app goes into background

This.... I'm not sure.... what scenario did you notice this behavior?

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 29, 2023

Prior to the my changes after events have been fetched, when I go to the home screen then re-open the app, the events are no longer there.

@hanhqvu hanhqvu closed this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG - DashboardView events Aren't Loading on the First Load
2 participants