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

Fix inherited urgency when parent and child have the same urgency #2941

Merged

Conversation

RonMcKay
Copy link
Contributor

Description

Fixes #2940.
Changing the comparison of the maximum child urgency and the parent urgency to prev <= value is fixing the wrong inheritance.

Additional information...

  • I changed C++ code or build infrastructure.
    Please run the test suite and include the output of cd test && ./problems.

    Failed:
    
    Unexpected successes:
    
    Skipped:
    dependencies.t                      1
    diag.t                              1
    export.t                            1
    feature.default.project.t           4
    filter.t                            1
    hooks.on-modify.t                   1
    import.t                            1
    nag.t                               5
    recurrence.t                        1
    tw-1999.t                           2
    wait.t                              1
    
    Expected failures:
    dependencies.t                      2
    filter.t                            3
    lexer.t                             4
    quotes.t                            1
    tw-2124.t                           1
    
  • I changed Rust code or build infrastructure.
    Please run cargo test and address any failures before submitting.

If the parent and child task have the same urgency the parent task also
needs the 0.01 extra urgency to be sorted above the child.
@smemsh
Copy link
Contributor

smemsh commented Sep 18, 2022

does this work correctly with cde8361?

@RonMcKay
Copy link
Contributor Author

RonMcKay commented Sep 18, 2022

No, that still happens with that fix.
PR #2760 rather makes the problem more consistent, as described in #2940.
If parent and child have the same urgency value, then the if condition in

taskwarrior/src/Task.cpp

Lines 2114 to 2120 in 0bae7d9

float prev = value;
value = std::max (value, urgency_inherit ());
// This is a hackish way of making sure parent tasks are sorted above
// child tasks. For reports that hide blocked tasks, this is not needed.
if (prev < value)
value += 0.01;

will not evaluate to true and thus the parent remains with the same urgency as it's child. This might sort it in reports under the child wrt. urgency (#2940).

@djmitche djmitche merged commit 9d9dde1 into GothenburgBitFactory:develop May 6, 2024
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.

Wrong inherited urgency when parent and child have the same urgency
3 participants