🐛 Bug Report
🔎 Describe the Bug
When a session begins, events are POST'ed to the database, but sessions are only saved after end_session is called.
🔄 Reproduction Steps
Create a session, send events, but don't end the session.
🙁 Expected Behavior
Post the session as soon as it is created. After end_session, update the session.
📸 Screenshots
Proposed fix, add start_session to the Worker:
def start_session(self, session: Session) -> None:
with self.lock:
payload = {
"session": session.__dict__
}
HttpClient.post(f'{self.config.endpoint}/sessions',
json.dumps(payload).encode("utf-8"),
self.config.api_key)
Current end session should remain the same:
def end_session(self, session: Session) -> None:
self.stop_flag.set()
self.thread.join()
self.flush_queue()
with self.lock:
payload = {
"session": session.__dict__
}
HttpClient.post(f'{self.config.endpoint}/sessions',
json.dumps(payload).encode("utf-8"),
self.config.api_key)
🐛 Bug Report
🔎 Describe the Bug
When a session begins, events are POST'ed to the database, but sessions are only saved after
end_sessionis called.🔄 Reproduction Steps
Create a session, send events, but don't end the session.
🙁 Expected Behavior
Post the session as soon as it is created. After
end_session, update the session.📸 Screenshots
Proposed fix, add
start_sessionto theWorker:Current end session should remain the same: