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

feedback opportunity's timestamp isn't rounded, which causes issues in feedback delivery #13

Open
kapil1garg opened this issue Apr 14, 2022 · 1 comment · Fixed by #14
Labels
bug Something isn't working

Comments

@kapil1garg
Copy link
Contributor

While the triggering and expiry timestamps are both rounded down to the nearest 5 minutes (as is the timestamp used to check when scripts are triggered or expired), the timestamp for feedback opportunity is not (see here). Below is an example of what the computed timestamps look like on the database:

image

With how the execution code is currently written, this causes scripts to not deliver feedback when they are suppose to (culprit here).

Some ways to fix it:

  • Make sure timestamp for feedback opportunity is rounded
  • Use >= instead of == for comparison (but maybe do check that the days are correct)

For testing, also good to add some jitter to the simulation timestamps (see here). The reason my tests didn't catch this before is because the simulation would always cause the timestamp to be rounded to the nearest 5 minutes since the system clock gets locked at that time during the simulation, whereas it takes time on the server and thus is no longer locked. Adding jitter to the timestamp allows us to simulate this happening so that the code tests can be more robust.

@kapil1garg kapil1garg added the bug Something isn't working label Apr 14, 2022
@kapil1garg kapil1garg linked a pull request Apr 15, 2022 that will close this issue
@kapil1garg
Copy link
Contributor Author

re-opening since the current fix is kinda jank (but should be working)

@kapil1garg kapil1garg reopened this Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant