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

[huesync] Fix lost api-token when device goes offline #18100

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

pgfeller
Copy link
Contributor

@pgfeller pgfeller commented Jan 12, 2025

➡️ Refactoring of connection handling

Refactored exception connection exception handling to provide more information and improve code structure/maintainability. Connection settings are no longer deleted if the device disconnects.

  • Analyze and reproduce issue
    • setup 4.3.x branch for development (for bug fixing I prefer the stable branch)
  • Avoid exceptions in the constructor of the thing handler
  • Never delete configuration automatically
  • 🛠️ Improve exception handling
    • Re-Initialise connection (e.g. if IP/Hostname changed)
    • Introduce/Improve common exception handling

  • interactive test of functionalities in productive environment (4.3.2)
  • prepare for review

@pgfeller pgfeller added the work in progress A PR that is not yet ready to be merged label Jan 12, 2025
@pgfeller pgfeller self-assigned this Jan 12, 2025
@pgfeller pgfeller force-pushed the huesync/issue/18062 branch from f1dfb75 to 48daebe Compare January 12, 2025 21:55
@pgfeller pgfeller requested a review from lsiepel January 12, 2025 21:58
@pgfeller
Copy link
Contributor Author

Hi @lsiepel - I've added you as reviewer already, but the fix is far from ready to be merged. But maybe it is easier for you to follow how the fix evolves rather than to review all at once. That way you can also comment at any time if you have concerns.

hope you are fine and as always - thanks for your work for the community and especially for your support to me 🙂

@pgfeller pgfeller force-pushed the huesync/issue/18062 branch 2 times, most recently from c4c5cf6 to 552b178 Compare January 24, 2025 15:57
@pgfeller pgfeller added the bug An unexpected problem or unintended behavior of an add-on label Jan 24, 2025
@pgfeller pgfeller linked an issue Jan 24, 2025 that may be closed by this pull request
@pgfeller pgfeller changed the title [WIP] fix(18062): 🛠️ [huesync] Configuration (API Token) lost if device goes offline [huesync] - Fix for issue #18062 - Configuration (API Token) lost if device goes offline Jan 24, 2025
@pgfeller pgfeller closed this Jan 24, 2025
@pgfeller pgfeller deleted the huesync/issue/18062 branch January 24, 2025 21:47
@pgfeller pgfeller restored the huesync/issue/18062 branch January 24, 2025 22:03
@pgfeller pgfeller reopened this Jan 24, 2025
@pgfeller pgfeller force-pushed the huesync/issue/18062 branch 2 times, most recently from bd7e07a to 116e8ce Compare January 24, 2025 22:49
@pgfeller pgfeller force-pushed the huesync/issue/18062 branch from 09d10ea to 47fd98f Compare February 1, 2025 20:13
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/huesync-patched-version-for-4-3-2-to-address-issue-18062/162197/1

@pgfeller pgfeller force-pushed the huesync/issue/18062 branch from 7223041 to 238a57b Compare February 16, 2025 11:36
…ffline

Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
@pgfeller pgfeller force-pushed the huesync/issue/18062 branch from 238a57b to e4c1906 Compare February 16, 2025 11:38
…ffline

Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
@pgfeller pgfeller marked this pull request as ready for review February 16, 2025 13:40
@pgfeller
Copy link
Contributor Author

@lsiepel & @openhab/add-ons-maintainers

The fix for issue #18062 is ready for review. I use it productively with 4.3.2 - so it would be easy to back port it to 4.3.x to be part of the next patch release. As this issue can be quite anoing.

with kind regards,
Patrik

@lsiepel lsiepel removed the work in progress A PR that is not yet ready to be merged label Feb 18, 2025
…binding/huesync/internal/types/HueSyncExceptionHandler.java

Signed-off-by: lsiepel <leosiepel@gmail.com>
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@lsiepel lsiepel changed the title [huesync] - Fix for issue #18062 - Configuration (API Token) lost if device goes offline [huesync] Fix lost api-token when device goes offline Feb 18, 2025
@lsiepel lsiepel merged commit a41c6d4 into openhab:main Feb 18, 2025
2 checks passed
@lsiepel lsiepel added this to the 5.0 milestone Feb 18, 2025
lsiepel pushed a commit that referenced this pull request Feb 18, 2025
* fix(18062): [huesync] Configuration (API Token) lost if device goes offline

Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
@lsiepel lsiepel added the patch A PR that has been cherry-picked to a patch release branch label Feb 18, 2025
matgroe pushed a commit to matgroe/openhab-addons that referenced this pull request Feb 24, 2025
* fix(18062): [huesync] Configuration (API Token) lost if device goes offline

Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
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 an add-on patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[huesync] Configuration (API Token) lost if device goes offline
3 participants