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

396 hrs autocomplete on expire #140

Merged
merged 10 commits into from
Aug 3, 2023
Merged

Conversation

wbaccinelli
Copy link
Contributor

@wbaccinelli wbaccinelli commented Aug 1, 2023

Fixes: PerfectFit-project/virtual-coach-issues#396
Fixes: PerfectFit-project/testing-tickets#25
Fixes: PerfectFit-project/virtual-coach-issues#393
Fixes: PerfectFit-project/testing-tickets#26

  • Storing the branch chosen by the user in the relapse dialog as a new closed answer
  • Moved the expiration case management from the celery_tsks to the single state for clarity
  • Improved intents management in ehbo
  • In the relapse state, the dialog is auto-completed in case a user-initiated relapse dialog expires, out of the relapse branch

Copy link
Contributor

@nelealbers nelealbers left a comment

Choose a reason for hiding this comment

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

Looks good, just added two thoughts/comments.


# if there are no answers or the answer came before the last execution of the dialog,
# return None
if last_answer is None or last_answer.datetime < last_execution.last_time:
Copy link
Contributor

Choose a reason for hiding this comment

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

So the last_time value is always only set when a dialog is completed, not yet when it is started?

Copy link
Contributor Author

@wbaccinelli wbaccinelli Aug 2, 2023

Choose a reason for hiding this comment

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

last_time is updated when the dialog is started, this is why if the answer came before that, it is for sure from another run

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I seee, that makes sense!

self.set_new_state(ExecutionRunState(self.user_id))

else:
next_day = datetime.now() + timedelta(days=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering if adding one day is a good idea, since there might be a structural reason why people did not complete the dialog now. For example, could we just use people's preferred time from the profile creation dialog for this? But I suppose especially at the start people might not yet have such a preferred time. And maybe this is just overcomplicating things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. We can also check if the preferred time has been set and use it if it exists, and add one day otherwise.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@wbaccinelli wbaccinelli merged commit e1f19a0 into main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment