sea-orm
sea-orm copied to clipboard
Panic with `PrimaryKey is not set` in update
There was a "PrimaryKey is not set" panic happening somewhere, and without a full backtrace environment it was hard to figure out where this was coming from. This took quite a while longer to find out why, as we expected that somehow the schema was borked based on other reports of what could cause this. Panics mess with logging machinery by truncating important output before it is shown. There was an edge case where an entry update could be called before an initial store actually succeeded, and apparently it can lead to the panic in https://github.com/SeaQL/sea-orm/blob/a3a47dd29124ff2f467be0afb64995ed1ca6d75c/src/query/update.rs#L99
Edit: no, the issue was actually some freaky state issue, but I think the points still hold