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

Add advanced imap option to set custom event max message size #93163

Merged

Conversation

jbouwh
Copy link
Contributor

@jbouwh jbouwh commented May 16, 2023

Proposed change

With the deprecation of the imap_email_content integration a custom event feature was added to the imap migration.
To prevent recoder log floads an errors for events that were to big we trucated the message body size to 2048 bytes.
This PR enables to increase the max message text size to be be passed as event data configurable as an advanced option.
The value can be set between (2048 .. 30000).
If the event data exceeds 32168 bytes a warning will be logged and the event will be skipped.

This PR offers a solution to deal with the breaking effects of #92066.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @engrbm87, mind taking a look at this pull request as it has been labeled with an integration (imap) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of imap can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign imap Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@jbouwh jbouwh marked this pull request as ready for review May 16, 2023 12:20
@jbouwh jbouwh changed the title Add advanced imap option to set max message size to custom event Add advanced imap option to set max message size in custom event May 16, 2023
@jbouwh jbouwh requested a review from MartinHjelmare May 20, 2023 13:15
@jbouwh jbouwh added the bugfix label May 22, 2023
@home-assistant home-assistant bot marked this pull request as draft May 22, 2023 10:02
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@jbouwh jbouwh marked this pull request as ready for review May 22, 2023 10:06
@home-assistant home-assistant bot requested a review from MartinHjelmare May 22, 2023 10:06
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good!

@MartinHjelmare MartinHjelmare changed the title Add advanced imap option to set max message size in custom event Add advanced imap option to set max custom event message size May 22, 2023
@MartinHjelmare MartinHjelmare changed the title Add advanced imap option to set max custom event message size Add advanced imap option to set custom event max message size May 22, 2023
@MartinHjelmare MartinHjelmare merged commit 5bc825a into home-assistant:dev May 22, 2023
@jbouwh jbouwh deleted the imap-max-message-size-option branch May 22, 2023 10:14
raman325 added a commit to raman325/home-assistant that referenced this pull request May 22, 2023
…fig_parameter

* 'dev' of https://github.com/home-assistant/core: (390 commits)
  Use snapshots in devolo_home_control tests (home-assistant#93202)
  Configurable KNX Telegram history size (home-assistant#93248)
  Bugfix and add test coverage for zwave_js.light (home-assistant#93257)
  Refactor zwave_js.fan and add tests (home-assistant#93256)
  Bugfix and small refactor for zwave_js.device_action (home-assistant#93261)
  Refactor zwave_js.sensor and add test coverage (home-assistant#93259)
  Improve test coverage for zwave_js.trigger (home-assistant#93260)
  Fix august configuration url with Yale Home brand (home-assistant#93361)
  Make mqtt device_tracker state_topic optional when json_attribute_topic is used (home-assistant#93322)
  Move HydrawiseEntity into entity.py (home-assistant#93359)
  Update Home Assistant base image to 2023.05.0 (home-assistant#93350)
  Adjust counter to not restore configuration parameters (home-assistant#93344)
  Deprecate counter.configure service (home-assistant#93343)
  Update zwave-me-ws version to 0.4.3 (home-assistant#93348)
  Add myself as a code owner of the Hydrawise integration (home-assistant#93358)
  Move Hydrawise constants into const.py (home-assistant#93357)
  Improve test coverage for zwave_js (home-assistant#93262)
  Add advanced imap option to set custom event max message size (home-assistant#93163)
  Bump zwave-js-server-python to 0.48.1 (home-assistant#93342)
  Bump `aionotion` to 2023.05.5 (home-assistant#93334)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IMAP integration body limited to 2048, was not an issue for imap_email_content
2 participants