Skip to content

Added JSONDecoder to fix server crash when creating a to-do item in HA - #1

Open
jshiflet wants to merge 1 commit into
cromulus:mainfrom
jshiflet:jshiflet/new-ha-todo-bugfix
Open

jshiflet wants to merge 1 commit into
cromulus:mainfrom
jshiflet:jshiflet/new-ha-todo-bugfix

Conversation

@jshiflet

Copy link
Copy Markdown

When creating a to-do item in Home Assistant, the ha-reminders-cli integration will error with one of two errors

Error during service call to todo.add_item: Failed to create reminder: Server disconnected

or

Error during service call to todo.add_item: Failed to create reminder: 502, message='Bad Gateway', url='https://[reverseProxyURL:port]/api/lists/[listName]/reminders'

This also causes the reminders-api process to crash on the macOS device with the following backtrace:

NullDecoder.decode(...) 
CodableProtocols.swift:48 
preconditionFailure("HBApplication.decoder has not been set")

Adding middleware JSON decoder resolves the base crash problem and allows the to-do item to be created

…ome Assistant integration

When creating a to-do item in Home Assistant, the ha-reminders-cli integration will error with one of two errors
- Error during service call to todo.add_item: Failed to create reminder: Server disconnected
- Error during service call to todo.add_item: Failed to create reminder: 502, message='Bad Gateway', url='https://[reverseProxyURL:port]/api/lists/[listName]/reminders'

This also causes the reminders-api process to crash on the macOS device with the following backtrace:
- NullDecoder.decode(...)
  CodableProtocols.swift:48
  preconditionFailure("HBApplication.decoder has not been set")

Adding middleware JSON decoder resolves the base crash problem and allows the to-do item to be created

Co-authored-by: codex <codex@openai.com>
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

Successfully merging this pull request may close these issues.

1 participant