[SERVER-49422] Prevent Timestamp comparison mistakes in the shell Created: 10/Jul/20  Updated: 06/Dec/22  Resolved: 10/Jul/20

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Backlog - Server Tooling and Methods (STM) (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-21861 Better Timestamp object comparison in... Closed
Assigned Teams:
Server Tooling & Methods
Participants:

 Description   

It's easy to think that Timestamp objects are comparable in the shell:

> Timestamp(1, 9) > Timestamp(1, 8)
true

But they are not:

> Timestamp(1, 9) > Timestamp(1, 10)
true

I don't know what the rules are for comparing Timestamps, but they're not correct. This leads to bugs like SERVER-41008. Let's either fix comparison, or make comparison operators throw an error so we remember to use timestampCmp from shell/utils.js.


Generated at Thu Feb 08 05:19:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.