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

Add generic model for session timed events #362

Open
rowanseymour opened this issue Nov 15, 2024 · 1 comment
Open

Add generic model for session timed events #362

rowanseymour opened this issue Nov 15, 2024 · 1 comment

Comments

@rowanseymour
Copy link
Member

Currently we have flows.flowsession.timeout_on and wait_expires_on to track when we need to timeout or expire a session wait. Two issues:

  • There's no immediate state change to say that we've queued the timeout/expire task and the actual change to the session db row might take a while to happen. So we have to use markers in Redis to prevent dupe handling by the task and we have the inefficiency of refetching sessions until the tasks complete.
  • We potentially want to stop writing sessions to the database.

Maybe we add a new model which just holds a timed event for a session:

  • Session ID
  • Contact ID
  • EventType (timeout vs expiration)
  • Time

A cron job processes those, queues them appropriately and deletes the row when done. No need to mark anything in Redis.

@rowanseymour
Copy link
Member Author

Reminder to self: it's courier that actually sets flows.flowsession.timeout_on when a message is actually sent, so it would have to be courier that creates the new thing too.

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

No branches or pull requests

1 participant