Skip to content

OneDrive backup: publish via internal broker, works with user management - #4376

Open
seaspotter wants to merge 1 commit into
openWB:masterfrom
seaspotter:fix-onedrive-publish-user-management
Open

seaspotter wants to merge 1 commit into
openWB:masterfrom
seaspotter:fix-onedrive-publish-user-management

Conversation

@seaspotter

@seaspotter seaspotter commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

#4375

Summary by Sourcery

Route OneDrive backup configuration updates through the internal broker to support user management.

Bug Fixes:

  • Ensure OneDrive backup configuration updates work with user management by publishing through the internal broker.

Enhancements:

  • Replace direct MQTT publishing with the shared internal publishing interface for OneDrive backup configuration and authorization updates.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="packages/modules/backup_clouds/onedrive/api.py" line_range="36" />
<code_context>
     log.debug("Config to MQTT:" + str(backupcloud_to_mqtt))

-    publish.single("openWB/set/system/backup_cloud/config", backupcloud_to_mqtt, retain=True, hostname="localhost")
+    pub_single("openWB/set/system/backup_cloud/config", backupcloud_to_mqtt, no_json=True)


</code_context>
<issue_to_address>
**Retained configuration stays stale**

When the internal broker is unavailable or rejects a publish, or the calling process exits before the queued QoS 0 message is sent, `pub_single` ignores the publish result and returns after queuing the update, so `save_tokencache` and `generateMSALAuthCode` report success before the retained configuration is persisted; refreshed credentials or authorization state disappear or remain stale.

Use a synchronous retained publish so the update is persisted before these functions return.

Also at `packages/modules/backup_clouds/onedrive/api.py:109`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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.

2 participants