Make create fail when blackboard document already exists
save() treats expected_revision=None as an unconditional update by copying the current revision and writing anyway, so create() can overwrite an existing session document instead of failing. If two workers race through get_or_create on the same new session_id, the later create can clobber data written by the first request (resetting state back to initial_data) while still advancing the revision, which is a real state-corruption risk for concurrent workflows.
Useful? React with πΒ / π.
Originally posted by @chatgpt-codex-connector[bot] in #58 (comment)
save()treatsexpected_revision=Noneas an unconditional update by copying the current revision and writing anyway, socreate()can overwrite an existing session document instead of failing. If two workers race throughget_or_createon the same newsession_id, the later create can clobber data written by the first request (resetting state back toinitial_data) while still advancing the revision, which is a real state-corruption risk for concurrent workflows.Useful? React with πΒ / π.
Originally posted by @chatgpt-codex-connector[bot] in #58 (comment)