Skip to content

Soft deleted rows are being returned in findAll using paranoid mode #8006

Closed

Description

@yossialush

What you are doing?

Soft deletion of row sets deletedAt column with utils.now() (look here). That means that the value would be machine's current timestamp. But when you'll try to retrieve data, the query for ignoring soft deleted rows would be using CURRENT_TIMESTAMP (look here) which is the DB's machine timestamp. If these two machines (Server and DB) clocks are not synced you'll end up with soft deleted rows included in your results.

const res = model.findAll(...)

What do you expect to happen?

Shouldn't get soft deleted rows at all. The value that should be set upon deletion is CURRENT_TIMESTAMP as well.

What is actually happening?

I'm getting rows which I've deleted.

__Dialect: postgres
__Database version: 9.5
__Sequelize version: 4.3.2

Activity

  1. added
    type: bug
    on Aug 31, 2017
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

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions