You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uses the with_cursor decorator, but calls it self recursively. If I am reading the sqlite docs and sqlite module docs correctly, this won't do the right thing, as the transaction type used is not recursive.
It looks like this is the only function that runs into this issue, but it would be good to make with_cursor resilient to this kind of error as well.
The text was updated successfully, but these errors were encountered:
It turns out that it does use transaction incorrectly, as the recursive call will cause the transaction in the parent call to be committed, without having the parent links written. If we crash immediately after that commit, we won't be able to load snapshots for that file, since there will be two leaf snapshots, and we will hit this exception.
There is also a transaction issue in MagicFolderConfig.get_local_snapshot accessing the .author property, which is itself decorated with with_cursor. However, this case is less of an issue since they are both read-only transactions.
tomprince
changed the title
Verify that MagicFolderConfig.store_local_snapshot uses transactions correctly.
Fix MagicFolderConfig.store_local_snapshot to use transactions correctly.
Jul 1, 2021
It uses the
with_cursor
decorator, but calls it self recursively. If I am reading the sqlite docs and sqlite module docs correctly, this won't do the right thing, as the transaction type used is not recursive.It looks like this is the only function that runs into this issue, but it would be good to make
with_cursor
resilient to this kind of error as well.The text was updated successfully, but these errors were encountered: