Skip to content

Delivery Tracker - FedEx Delivery Date Bug Fix#17627

Merged
raycastbot merged 10 commits intoraycast:mainfrom
halprin:deliver-tracker-fix-date-bug
Mar 7, 2025
Merged

Delivery Tracker - FedEx Delivery Date Bug Fix#17627
raycastbot merged 10 commits intoraycast:mainfrom
halprin:deliver-tracker-fix-date-bug

Conversation

@halprin
Copy link
Contributor

@halprin halprin commented Mar 7, 2025

Description

Fixed a bug for the delivery date from FedEx. People living in timezones with a negative UTC offset incorrectly saw delivery dates a day earlier for FedEx. This has been fixed.

The screenshot below would have incorrectly displayed "Sun Mar 9 2025" before this bug fix.

Screencast

Screenshot 2025-03-06 at 8 04 10 PM

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: delivery-tracker Issues related to the delivery-tracker extension OP is author The OP of the PR is the author of the extension labels Mar 7, 2025
@raycastbot
Copy link
Collaborator

Thank you for the update! 🎉

Due to our current reduced availability, the initial review may take up to 10-15 business days

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR fixes a timezone-related bug in the FedEx delivery date handling for users in negative UTC offset timezones, along with dependency updates and CI workflow improvements.

  • Fixed timezone handling in /extensions/delivery-tracker/src/carriers/fedex.ts by using local timezone for estimated delivery dates without accurate time info
  • Added new build-dist script in package.json and updated CI workflow to use it
  • Updated dev dependencies including TypeScript 5.8.2, Prettier 3.5.3, and @raycast/migration 1.93.0
  • Consider using showFailureToast from @raycast/utils instead of manual error handling in FedEx API calls

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

function convertFedexDateToDate(fedexDate: string | undefined): Date | undefined {
if (!fedexDate) {
return undefined;
function convertFedexDateToDate(fedexDate: [{ type: string; dateTime: string }]): Date | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: The function parameter type suggests an array with exactly one element, but FedEx might return multiple date entries. Consider using Array<{ type: string; dateTime: string }> instead of the tuple type.

Suggested change
function convertFedexDateToDate(fedexDate: [{ type: string; dateTime: string }]): Date | undefined {
function convertFedexDateToDate(fedexDate: Array<{ type: string; dateTime: string }>): Date | undefined {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


if (estimatedDeliveryDate) {
// use the current timezone of the computer running Raycast
const [year, month, day] = estimatedDeliveryDate.split("T")[0].split("-").map(Number);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Consider adding validation for the date parts before using them. Invalid date strings could cause runtime errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's logic at a higher level for catching any runtime errors if FedEx decides to change the API out from under me. The chance of that happening is very small.

@halprin halprin changed the title Deliver Tracker - FedEx Delivery Date Bug Fix Delivery Tracker - FedEx Delivery Date Bug Fix Mar 7, 2025
Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋

Looks good to me, approved 🔥

@raycastbot raycastbot merged commit 690ba97 into raycast:main Mar 7, 2025
2 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2025

Published to the Raycast Store:
https://raycast.com/halprin/delivery-tracker

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@halprin halprin deleted the deliver-tracker-fix-date-bug branch March 7, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: delivery-tracker Issues related to the delivery-tracker extension extension fix / improvement Label for PRs with extension's fix improvements OP is author The OP of the PR is the author of the extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants