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

Move from PostMeal to PreMeal for New Meals #23

Open
amalnanavati opened this issue Apr 19, 2023 · 2 comments · Fixed by #49
Open

Move from PostMeal to PreMeal for New Meals #23

amalnanavati opened this issue Apr 19, 2023 · 2 comments · Fixed by #49
Assignees
Labels
bug Something isn't working critical-path Issues that are critical path for deployment

Comments

@amalnanavati
Copy link
Contributor

The app's current mealState is stored in cookies, which persist after meals. Therefore, if one meal finishes and the user closes the app, when they re-open the app for the next meal it will still be in PostMeal. However, we want it to start in PreMeal.

One way of addressing it is to have the app store the timestamp of the last state transition in global state. Then, before rendering either App.jsx or Home.jsx (TBD -- the assignee of this issue can make an informed decision about which) the app checks whether it is in PoseMeal and more than some time (2 mins?) has passed between the last state changed time and the current time. If so it changes the mealState from PostMeal to PreMeal.

@amalnanavati amalnanavati mentioned this issue Apr 19, 2023
2 tasks
@amalnanavati amalnanavati self-assigned this May 10, 2023
@amalnanavati amalnanavati linked a pull request May 10, 2023 that will close this issue
13 tasks
@amalnanavati amalnanavati reopened this May 26, 2023
@amalnanavati
Copy link
Contributor Author

Re-opening due to a bug where if the robot was on a moving state and then is closed for an hour, when it is re-opened it first calls the moving action, then cancels the moving action, and then renders the start feeding screen. This is a bug.

@amalnanavati amalnanavati added bug Something isn't working critical-path Issues that are critical path for deployment labels Jun 4, 2023
@amalnanavati
Copy link
Contributor Author

As I was trying to address this, I was sometimes getting strange behavior where if we pause and then resume after a while, it wouldn't work because rosbridge can't find the action client. I'm not sure exactly what causes that, but it may have something to do with the fact that RobotMotion destroys the action server in the return of useEffect, even though it creates it with useMemo? Regardless, this collection of bugs is crucial to look into!

To recreate, pause a robot motion, then wait for a while (1.5 mins?) and resume, and it probably won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical-path Issues that are critical path for deployment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant