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

Remove lock from documents that fail to close #46

Closed
nezuo opened this issue Apr 9, 2024 · 2 comments
Closed

Remove lock from documents that fail to close #46

nezuo opened this issue Apr 9, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@nezuo
Copy link
Owner

nezuo commented Apr 9, 2024

Example implementation:

UpdateAsync(function(oldData)
    if oldData.lockId == document.lockId then
        oldData.lockId = nil
        return oldData
    end

    return nil
end)

As long as the current lock is still the same as the documents, it should be safe to remove it.

@nezuo nezuo added the enhancement New feature or request label Apr 9, 2024
@nezuo
Copy link
Owner Author

nezuo commented Aug 21, 2024

These are the cases a document will fail to close that we should attempt to remove the session lock:

  • validate throws an error.
  • data fails to pass validate
  • beforeSave errors
  • beforeClose errors

@nezuo
Copy link
Owner Author

nezuo commented Aug 24, 2024

Closed by #66.

@nezuo nezuo closed this as completed Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant