Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing date with widgets generates "invalid date" #630

Closed
unode opened this issue Sep 4, 2023 · 9 comments
Closed

Editing date with widgets generates "invalid date" #630

unode opened this issue Sep 4, 2023 · 9 comments

Comments

@unode
Copy link

unode commented Sep 4, 2023

Steps to reproduce:

  1. In an email draft click Send Later
  2. Select a day with the day widget selector - pick tomorrow
  3. Select an hour by typing the number manually - type 8 TAB 0 TAB A (for AM)
  4. Click outside the Send Later floating window
  5. Click Send Later again

After 5. the date shows as mm/dd/yyyy, the hour --:-- -- and the "Send at" button shows Enter a valid date above.

  1. Removing AM from the Send at: textual field makes the widget recognize the date and the Send button shows the correct time estimate.

I don't have any LC_ variables defined.
Thunderbird is version 102.14.0
Send Later is v10.1.5

Screenshots

After manually setting AM in the widget

screenshot_2023-09-05_00-53-25_697618764

After closing and opening the Send Later dialog when a time and date had been previously selected using the widgets

screenshot_2023-09-05_00-57-23_873687657

After deleting AM in the Send at field.

screenshot_2023-09-05_00-53-44_929773814

@jikamens
Copy link
Contributor

jikamens commented Sep 5, 2023

This is not the behavior I see. See the attached video below.

I don't have any LC_ variables defined.

Regardless, this is a locale issue of some sort, because whatever locale Send Later is parsing dates in doesn't understand the AM.

If you install version 10.1.6 of Send Later (instructions below) and then restart and search for "locale" in your error console (type Ctrl-Shift-J to open it and then enter locale in the filter box at the top), you should see a line from Send Later showing what your configured UI and OS locales are. My guess is that your OS locale is one where the date parser doesn't understand how to parse "AM".

In any case you can work around this problem by enabling customized date formats in the Send Later preferences and setting the short format to this: %m/%d/%Y, %R . This will force the time that gets inserted into the text box to be in 24-hour format. Though if you really want to eliminate ambiguity you might want to use %F, instead of %m/%d/%Y, since %F will give you YYYY-MM-DD format.

I'm closing this issue because to my knowledge the add-on is behaving as designed and in any case the date format customization is exactly intended to provide a workaround for issues like this, so a fix is available already.

Screencast.from.2023-09-04.21-21-36.webm

To install 10.1.6:

  • Download this file to your computer. (If you are using Firefox, make sure to right click on the link and select
    "Save Link As..." rather than just clicking on it, because otherwise Firefox will try to install it as a Firefox add-on.)
  • Open the Add-ons page in Thunderbird ("Add-ons and Themes" from the corner "hamburger" menu).
  • Click the gear icon at the top and select "Install Add-on From File...".
  • Browse to and select the downloaded file.
  • Click through the installation pop-ups.
  • You can delete the downloaded file once you've installed it into Thunderbird.

@jikamens jikamens closed this as completed Sep 5, 2023
@unode
Copy link
Author

unode commented Sep 5, 2023

Version 10.1.6 installed but I don't find "locale" on the error console output, only:

addons.webextension.sendlater3@kamens.us	WARN	Loading extension 'sendlater3@kamens.us': Reading manifest: Warning processing permissions: Error processing permissions.8: Value "messagesImport" must either: must either [must either [must either [be one of ["idle"], be one of ["menus.overrideContext"], be one of ["activeTab"], be one of ["cookies"], be one of ["scripting"], or be one of ["webRequest", "webRequestBlocking", "webRequestFilterResponse.serviceWorkerScript"]], must either [be one of ["mozillaAddons"], be one of ["activityLog"], be one of ["networkStatus"], or be one of ["telemetry"]], be one of ["alarms", "storage", "unlimitedStorage"], be one of ["geckoProfiler"], be one of ["identity"], be one of ["menus"], be one of ["contextualIdentities"], be one of ["dns"], or be one of ["theme"]], must either [must either [be one of ["idle"], be one of ["menus.overrideContext"], be one of ["activeTab"], be one of ["cookies"], be one of ["scripting"], or be one of ["webRequest", "webRequestBlocking", "webRequestFilterResponse.serviceWorkerScript"]], be one of ["clipboardRead", "clipboardWrite", "geolocation", "notifications"], be one of ["accountsRead"], be one of ["addressBooks"], be one of ["browsingData"], be one of ["compose", "compose.save", "compose.send"], be one of ["messagesModify"], be one of ["accountsFolders"], be one of ["accountsIdentities"], be one of ["messagesMove", "messagesRead", "messagesDelete", "messagesTags"], be one of ["pkcs11"], be one of ["tabs", "tabHide"], be one of ["browserSettings"], be one of ["downloads", "downloads.open"], be one of ["management"], be one of ["privacy"], be one of ["proxy"], be one of ["nativeMessaging"], or be one of ["webNavigation"]], or match the pattern /^experiments(\.\w+)+$/], or must either [be one of ["<all_urls>"], must either [match the pattern /^(https?|wss?|file|ftp|\*):\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$/, or match the pattern /^file:\/\/\/.*$/], or match the pattern /^resource:\/\/(\*|\*\.[^*/]+|[^*/]+)\/.*$|^about:/]

@jikamens
Copy link
Contributor

jikamens commented Sep 5, 2023

Try disabling and re-enabling the add-on on the add-ons page and then check the error console again. Sometimes for some reason messages that get logged right when Thunderbird is starting up don't show up in the error console.

@unode
Copy link
Author

unode commented Sep 5, 2023

Shown now but:

Send Later version 10.1.6 on Thunderbird 102.14.0 (20230903124808) [linux x86-64] UI locale en-US, Date Locale en-US [tools.js:59:13](moz-extension://50e7363c-6f0f-4e25-bf08-d2d78d94251d/utils/tools.js)

Looks like a rather common Locale.

@jikamens
Copy link
Contributor

jikamens commented Sep 5, 2023

That's fascinating.

I have no idea why it's behaving this way.

Reopening the issue to remind me to give it some more thought and try to figure it out.

Nevertheless the workaround I suggested above should work for you. Let me know if it doesn't.

@jikamens jikamens reopened this Sep 5, 2023
@unode
Copy link
Author

unode commented Sep 5, 2023

I think I may have found the issue.

When I input a date using the date and time selectors I get 9/5/2023, 8:32 PM
but when I insert it manually I get 9/5/2023, 8:32 PM
it's a subtle difference but the space between the time and PM is different in the two cases.

The character inserted by the widget is -> 0x202F whereas a regular space is -> 0x20. This causes the parsing error.

I have no idea why the widget inserts this character instead of a space...

@jikamens
Copy link
Contributor

jikamens commented Sep 5, 2023

Aha: nodejs/node#45938

@jikamens
Copy link
Contributor

jikamens commented Sep 5, 2023

This issue should be fixed in release 10.1.7 of Send Later. To check what version of Send Later you have:

  • Open the Add-ons page in Thunderbird ("Add-ons and Themes" from the corner "hamburger" menu).
  • Click on Extensions on the left if you're not already on the left if you're not already there.
  • Find Send Later in the list of extensions and click on it to open its details page.
  • The version number should be displayed there next to
    "Version".

This release is not yet available for download from addons.thunderbird.net, but you can download and install it from its GitHub release page as follows:

  • Download this file to your computer. (If you are using Firefox, make sure to right click on the link and select
    "Save Link As..." rather than just clicking on it, because otherwise Firefox will try to install it as a Firefox add-on.)
  • Open the Add-ons page in Thunderbird ("Add-ons and Themes" from the corner "hamburger" menu).
  • Click the gear icon at the top and select "Install Add-on From File...".
  • Browse to and select the downloaded file.
  • Click through the installation pop-ups.
  • You can delete the downloaded file once you've installed it into Thunderbird.

Note that this is a prerelease. While we make every effort to ensure that prereleases are stable, they are a bit more likely to have bugs, so proceed with caution.

If you prefer to wait, the release will eventually be available on addons.thunderbird.net, and unless you've turned off automatic add-on updates, Thunderbird will eventually update to the new version automatically. To update immediately once it's available:

  • Go to addons.thunderbird.net and confirm that release 10.1.7 is available for download there.
  • Open the Add-ons page in Thunderbird ("Add-ons and Themes" from the corner "hamburger" menu).
  • Click on Send later.
  • Click the gear icon and select "Check for Updates".
  • The add-on should update and then you should see the message, "Your add-ons have been updated," next to the gear icon.

Please let me know if you still see this issue in this release.

@unode
Copy link
Author

unode commented Sep 6, 2023

Confirmed, bug is now gone.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants