You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to create a Send via an HTTP request while "bw serve" run using the template JSON send.text
Expected Result
A new "Send" is create
Actual Result
Failed because the date is not valid.
Screenshots or Videos
No response
Additional Context
I've tracked the issue to the related code.
The issue come from the if condition in the file clients/apps/cli/src/tools/send/commands/create.command.ts on line 53
if(req.deletionDate==null||// return true if deletion date is nullisNaN(newDate(req.deletionDate).getTime())||// return true if deletion date is NaNnewDate(req.deletionDate)<=newDate()// return true if the date can be cast properly){returnResponse.badRequest("Must specify a valid deletion date after the current time");}
The first line of the condition return true if the deletion date is null, the second one return true if the deletion date equal NaN and the last one return true if the deletion date can be cast to a date object so the condition is always true.
Reverse the check on the last line to return true if the date can't be cast properly to a date object.
!(newDate(req.deletionDate)<=newDate())// return the good boolean
Operating System
Linux
Operating System Version
Arch
Shell
Zsh
Build Version
2024.4.1
Issue Tracking Info
I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
The text was updated successfully, but these errors were encountered:
Thank you for your report! I have flagged this to our engineering team.
If you wish to add any further information/screenshots/recordings etc., please feel free to do so at any time - our engineering team will be happy to review these.
Steps To Reproduce
Try to create a Send via an HTTP request while "bw serve" run using the template JSON send.text
Expected Result
A new "Send" is create
Actual Result
Failed because the date is not valid.
Screenshots or Videos
No response
Additional Context
I've tracked the issue to the related code.
The issue come from the
if
condition in the file clients/apps/cli/src/tools/send/commands/create.command.ts on line 53The first line of the condition return true if the deletion date is null, the second one return true if the deletion date equal NaN and the last one return true if the deletion date can be cast to a date object so the condition is always true.
Reverse the check on the last line to return true if the date can't be cast properly to a date object.
Operating System
Linux
Operating System Version
Arch
Shell
Zsh
Build Version
2024.4.1
Issue Tracking Info
The text was updated successfully, but these errors were encountered: