Skip to content

Node::is_syncable can overflow the stack for very deep bookmark trees #73

Description

@linabutler

When Dogear builds a merged tree, it recurses down into each folders; then, for each node in the folder, it recurses back up the tree to figure out if that node should be synced. This recursion can overflow the stack for very deep trees; https://bugzilla.mozilla.org/show_bug.cgi?id=1916299 has an example of just such a tree (almost 2k levels! 🤯)

Since we know which root a node descends from when we build the local and remote trees, we can store an is_syncable flag directly on the node instead—no need to do a ton of expensive work to reconstruct information that we already had!

(I'm having even more of an egg-on-face moment from this one, because the is_syncable check is really there to handle edge cases from 6 years ago...these days, I don't expect us to see any non-syncable items! 🫢)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions