Skip to content

Commit

Permalink
places: Remove the transaction from fetch_tree_with_depth.
Browse files Browse the repository at this point in the history
Originally, we used multiple SELECTs to populate the tree, and needed
the read-only transaction to avoid interleaved writes. The multiple
SELECTs were removed in mozilla#1289, so the transaction (1) isn't needed
anymore, and (2) causes issues when calling `fetch_tree_with_depth`
concurrently.

Closes mozilla#5773.
  • Loading branch information
linabutler committed Aug 28, 2023
1 parent 259e736 commit 47297f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

[Full Changelog](In progress)

## Places

### 🦊 What's Changed 🦊

- `fetch_tree_with_depth` no longer starts a transaction when reading from the database. The transaction causes issues with concurrent calls, and isn't needed for consistency anymore ([#5790](https://github.com/mozilla/application-services/pull/5790)).

# v118.0 (_2023-08-28_)

## General
Expand Down
1 change: 0 additions & 1 deletion components/places/src/storage/bookmarks/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ pub fn fetch_tree_with_depth(
item_guid: &SyncGuid,
target_depth: &FetchDepth,
) -> Result<Option<Item>> {
let _tx = db.begin_transaction()?;
let (tree, parent_guid, position) = if let Some((tree, parent_guid, position)) =
json_tree::fetch_tree(db, item_guid, target_depth)?
{
Expand Down

0 comments on commit 47297f5

Please sign in to comment.