Code Monkey home page Code Monkey logo

Comments (6)

hgtw avatar hgtw commented on June 11, 2024

It's a bug, changing

size_t erased = m_completed_tasks.size() - before;

to

size_t erased = before - m_completed_tasks.size();
should fix it

from server.

noudess avatar noudess commented on June 11, 2024

It's a bug, changing

size_t erased = m_completed_tasks.size() - before;

to
size_t erased = before - m_completed_tasks.size(); should fix it

How? size_t is always unsigned. So it deleted no matter the order?

The delete seems correct, but I don't see where the new one is added to the db?

from server.

hgtw avatar hgtw commented on June 11, 2024

before should be greater than m_completed_tasks.size() after the erase, so currently erased will underflow and cause m_last_completed_task_loaded to increment instead of decrement after sign conversions. This prevents the db replace in SaveClientState because it's now bigger than m_completed_tasks.size. I assume the task code is just using that variable as a dirty flag for a db update.

edit:

How? size_t is always unsigned. So it deleted no matter the order?

Yes this would delete no matter the order if something was erased, just the db replace doesn't occur to reinsert it with updated time

from server.

noudess avatar noudess commented on June 11, 2024

You ok with PRing this since you clearly have a better grasp?

from server.

hgtw avatar hgtw commented on June 11, 2024

Feel free, it needs confirmation anyway

from server.

noudess avatar noudess commented on June 11, 2024

I've disabled the rule locally. I don't feel comfortable taking this on.

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.