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

Let fetch_tree also returns position and parent_guid #1289

Merged
merged 1 commit into from
Jun 14, 2019
Merged

Let fetch_tree also returns position and parent_guid #1289

merged 1 commit into from
Jun 14, 2019

Conversation

0x00A5
Copy link
Contributor

@0x00A5 0x00A5 commented Jun 13, 2019

fixes #808

Copy link
Contributor

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't exactly what I had expected, but it's probably less churn than adding fields to BookmarkTreeNode.

Can you make sure that we have test coverage here? E.g. if this code had done the wrong thing, do any tests fail? If not, can you add one that makes sure the positions are right?

@0x00A5
Copy link
Contributor Author

0x00A5 commented Jun 13, 2019

Sure, I will add tests for fetch_tree function. If somewhere else could benefit from adding the 2 fields to BookmarkTreeNode, please let me know. I am willing to make the change.

@thomcc
Copy link
Contributor

thomcc commented Jun 13, 2019

If somewhere else could benefit from adding the 2 fields to BookmarkTreeNode, please let me know. I am willing to make the change.

No, for now this is fine (this function isn't used elsewhere), and is a lot simpler and easy for me to review than had you modified the big fetch_tree query :p.

@@ -1124,7 +1124,10 @@ fn inflate(

/// Fetch the tree starting at the specified folder guid.
/// Returns a BookmarkTreeNode::Folder(_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, one more thing, this should be updated.

Suggested change
/// Returns a BookmarkTreeNode::Folder(_)
/// Returns a `BookmarkTreeNode::Folder(_)`, its parent's guid (if any), and
/// position inside its parent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-review whenever you get a chance, thanks!

Copy link
Contributor

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomcc thomcc merged commit b817be7 into mozilla:master Jun 14, 2019
linabutler added a commit that referenced this pull request Aug 26, 2023
Originally, we used multiple SELECTs to populate the tree, and the
transaction was needed to avoid interleaved writes. These SELECTs were
removed in #1289, so the transaction is no longer necessary, and can
also cause issues when calling `fetch_tree_with_depth` concurrently.

Closes #5773.
linabutler added a commit that referenced this pull request Aug 26, 2023
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 #1289, so the transaction (1) isn't needed
anymore, and (2) causes issues when calling `fetch_tree_with_depth`
concurrently.

Closes #5773.
linabutler added a commit that referenced this pull request Aug 28, 2023
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 #1289, so the transaction (1) isn't needed
anymore, and (2) causes issues when calling `fetch_tree_with_depth`
concurrently.

Closes #5773.
github-merge-queue bot pushed a commit that referenced this pull request Aug 28, 2023
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 #1289, so the transaction (1) isn't needed
anymore, and (2) causes issues when calling `fetch_tree_with_depth`
concurrently.

Closes #5773.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fetch_tree should return position and parentGUID information
2 participants