Repository navigation
fix(paranoid): use Utils.now to query for paranoid records - #8485
Conversation
|
Will also close #7787 but we dont have proper way to test that db / app server timezone difference. If we distill what all those threads are saying, we can conclude
If db and app server use different timezone, this will surely get incorrect records. I think we should use application server time, hence changing |
|
@sushantdhiman This sounds good! I'm down to using application server time for the clause. |
|
Correct me if I'm wrong, but I don't think this fundamentally fixes a lot of the linked issues because Happy to file an issue if you want to move discussion elsewhere. |
|
@gabegorelick Most of linked issue are appearing because querying and setting of deletedAt are using entirely different construct (new Date vs CURRENT_TIMESTAMP), which would always fail for cross timezone interactions. With this PR both construct aligns to use singular source i.e. new Date. This will ensure paranoid records aren't returned even if clocks aren't synced, because now we are using only app server clock for all cases. Leap seconds like issues are a bit hard to test and honestly I don't worry about them in current context which is failing paranoid for every cross timezone case. But you are free to discuss this among other contributors by opening an issue if you like to |
|
Thanks @sushantdhiman. We can continue discussion in #8496. |
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
Fixes #8202
Fixes #8006
Closes #8204
Closes #7787