Skip to content

Commit

Permalink
Try uploading the twomemo bundle again without MAX_ITEMS if that opti…
Browse files Browse the repository at this point in the history
…on is not supported
  • Loading branch information
Syndace committed Oct 8, 2024
1 parent 4e914e6 commit 88026c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed
- Load the twomemo backend even though SCE is not supported
- Treat malformed device list as empty instead of an unrecoverable error
- Try uploading the twomemo bundle again without MAX_ITEMS if that option is not supported

## [1.1.0] - 7th of October, 2024

Expand Down
18 changes: 16 additions & 2 deletions slixmpp_omemo/xep_0384.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,22 @@ async def _upload_bundle(bundle: omemo.Bundle) -> None:
"pubsub#max_items": "max"
}
)
except Exception as e:
raise BundleUploadFailed(f"Bundle upload failed: {bundle}") from e
except Exception: # pylint: disable=broad-exception-caught
# Try again without MAX_ITEMS set, which is not strictly necessary.
try:
await _publish_item_and_configure_node(
xep_0060,
our_bare_jid,
node,
item,
item_id=str(bundle.device_id),
options={
"pubsub#access_model": "open",
"pubsub#persist_items": "true"
}
)
except Exception as e:
raise BundleUploadFailed(f"Bundle upload failed: {bundle}") from e

return

Expand Down

0 comments on commit 88026c3

Please sign in to comment.