[DOCS-7146] Fix "Transactions in Applied State" dateThreshold example Created: 12/Feb/16  Updated: 30/Oct/23  Resolved: 01/Nov/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: collector-298ba4e7, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested in Chrome 48.0.2564.109 m

Location: https://docs.mongodb.com/manual/tutorial/perform-two-phase-commits/#transactions-in-applied-state
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
Referrer: https://www.google.ca/
Screen Resolution: 1920 x 1080
repo: docs
source: tutorial/perform-two-phase-commits


Participants:
Days since reply: 1 year, 14 weeks, 1 day ago
Epic Link: DOCSP-1769
Story Points: 0.2

 Description   

The second example under the Regarding Multiple Applications header has a bug when getting the dateThreshold.
When new Date() returns a date which has a minutes value less than 30, setMinutes() is called with a negative value and as a result the date is invalidated.

The proper way to get dateThreshold is as follows:

var dateThreshold = new Date();
dateThreshold = new Date(dateThreshold.getTime() - 30*60*1000)



 Comments   
Comment by Education Bot [ 01/Nov/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:53:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.