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

Force English locale to parse marketplace UI components timestamp #2663

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

ghys
Copy link
Member

@ghys ghys commented Jan 3, 2022

Related to https://community.openhab.org/t/error-installing-widgets-from-community-in-user-interfaces/128729/16

When the locale is not English the timestamp might fail to be deserialized into a Date:

2022-01-02 21:01:42.260 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Unable to parse YAML: Cannot deserialize value of type `java.util.Date` from String "Oct 2, 2021, 9:24:59 PM": not a valid representation (error: Failed to parse Date value 'Oct 2, 2021, 9:24:59 PM': Unparseable date: "Oct 2, 2021, 9:24:59 PM")

 at [Source: (StringReader); line: 36, column: 12] (through reference chain: org.openhab.core.ui.components.RootUIComponent["timestamp"])

2022-01-02 21:01:42.261 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Widget from marketplace is invalid: Unable to parse YAML

Related to https://community.openhab.org/t/error-installing-widgets-from-community-in-user-interfaces/128729/16

When the locale is not English the timestamp might fail to be deserialized into a Date:

```
2022-01-02 21:01:42.260 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Unable to parse YAML: Cannot deserialize value of type `java.util.Date` from String "Oct 2, 2021, 9:24:59 PM": not a valid representation (error: Failed to parse Date value 'Oct 2, 2021, 9:24:59 PM': Unparseable date: "Oct 2, 2021, 9:24:59 PM")

 at [Source: (StringReader); line: 36, column: 12] (through reference chain: org.openhab.core.ui.components.RootUIComponent["timestamp"])

2022-01-02 21:01:42.261 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Widget from marketplace is invalid: Unable to parse YAML
```
@ghys ghys requested a review from a team as a code owner January 3, 2022 17:20
Signed-off-by: Yannick Schaus <github@schaus.net>
@ghys
Copy link
Member Author

ghys commented Jan 3, 2022

Sorry forgot the DCO on the first commit...

Signed-off-by: Yannick Schaus <github@schaus.net>

Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Does it solve #2530 ?

No problem with your sign-offs. We trust in you 😉 .

@ghys
Copy link
Member Author

ghys commented Jan 3, 2022

Does it solve #2530 ?

Ha, missed that one, yes it's the same issue.

We trust in you 😉 .

Well thanks, but I can't even guarantee it will solve the problem as I've made this PR on GitHub directly hoping not to make spotless and SAT scream ;)
I believe it will, but if it doesn't there's the option to just remove the timestamp line from the YAML with a regex replace.

@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Jan 4, 2022
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@wborn wborn merged commit 96e8d36 into openhab:main Jan 4, 2022
@wborn wborn added this to the 3.3 milestone Jan 4, 2022
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
…enhab#2663)

Related to https://community.openhab.org/t/error-installing-widgets-from-community-in-user-interfaces/128729/16

When the locale is not English the timestamp might fail to be deserialized into a Date:

```
2022-01-02 21:01:42.260 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Unable to parse YAML: Cannot deserialize value of type `java.util.Date` from String "Oct 2, 2021, 9:24:59 PM": not a valid representation (error: Failed to parse Date value 'Oct 2, 2021, 9:24:59 PM': Unparseable date: "Oct 2, 2021, 9:24:59 PM")

 at [Source: (StringReader); line: 36, column: 12] (through reference chain: org.openhab.core.ui.components.RootUIComponent["timestamp"])

2022-01-02 21:01:42.261 [ERROR] [munity.CommunityUIWidgetAddonHandler] - Widget from marketplace is invalid: Unable to parse YAML
```

Signed-off-by: Yannick Schaus <github@schaus.net>
GitOrigin-RevId: 96e8d36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[marketplace] Cannot deserialize value of type java.util.Date from String "Oct 4, 2021, 11:28:30 PM"
3 participants