Skip to content

[IMPROVEMENT] Pre-compute card priorities - sequence of inheritance check #114

@hugomarins

Description

@hugomarins

Pre-compute card priorities is a command that runs a function for pre-tagging all flashcards that are not yet tagged manually. It will check for inheritance from ancestors and tag the rem cardPriority, add the priority and the priority source (inherited, in case it find an ancestor with any priority [Incremental or cardPriority], or default, in case it do not find prioritized ancestors).

But if I change the priority of an ancestor (let's say of a top-level rem) and run the command, the expected behavior is that the new priority will propagate to all the chain of descendants (all but the manually set priorities will be updated to the new inheritance priority value).

But in the current state of the code, as there is no mechanism to ensure top-level rems will be verified first, then second-level rems, then third-level rems, and so on, the rems are randomly verified and updated. If a grandchild runs the command first then a child, it will inherit a priority that has not yet been updated. For this reason, only after running the command 3-5 times I will ensure all priorities have been correctly propagated.

We need to check the idea batchUpdateInheritedPriorities (in card_priority/index.ts), as it appears to update all the descendants, to see if it can be used to solve it, without adding to many computational penalty. Or create a mechanism to make this verification follow the order of the knowledge tree, starting from top-level rems, going then in the direction of the branches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions