Skip to content
  • Ryuta Kamizono's avatar
    ddf7f10e
    Fix `save` in `after_create_commit` won't invoke extra `after_create_commit` · ddf7f10e
    Ryuta Kamizono authored
    Since a record is already persisted in `after_create_commit`, so `save`
    should invoke only `after_update_commit`.
    
    This bug is caused by depending on `@_start_transaction_state` for
    rollback to consider whether it was `new_record` before being committed.
    
    If after commit callbacks caused another commit, the state before
    last commit is no longer `new_record`.
    
    Fixes #32831.
    Closes #18367.
    Closes #31106.
    ddf7f10e
    Fix `save` in `after_create_commit` won't invoke extra `after_create_commit`
    Ryuta Kamizono authored
    Since a record is already persisted in `after_create_commit`, so `save`
    should invoke only `after_update_commit`.
    
    This bug is caused by depending on `@_start_transaction_state` for
    rollback to consider whether it was `new_record` before being committed.
    
    If after commit callbacks caused another commit, the state before
    last commit is no longer `new_record`.
    
    Fixes #32831.
    Closes #18367.
    Closes #31106.
Loading