A constraint name was missing on the `PubsubNode.pep` column, resulting in a crash when
trying to generate the initial database on launch with an empty `local_dir`.
Migration script introducing the column (f4cb5fc600c7_add_missing_pep_check_constraint.py)
has been updated too. Another migration script has been made to add the constraint to
existing DB (only if they are missing).
On room join, the room object is created before the server's self-presence arrives.
`_getRoomUser()` thus returns `user=None` for the initial presence, which led to
`super().availableReceived(presence)` not being called, resulting in wrong typing of the
room and the room not really being joined.
`get_avatar()` was checking the cache directly, bypassing `plugin_misc_identity`'s
`use_cache` flag. As a result, cache disabling was ineffective. It now fetches from the
PEP node and doesn't handle the cache anymore.
`_parse_metadata_info()` has been added to factorize the metadata parsing.
Libervia calls Tx-XMPP `typeCheck` on disco info reception to check and normalize values.
In the case of XEP-0115 this cause trouve as the normalization is lossy, and change the
type of some fields (booleans, JIDs). The new `raw_values` property has been added in
Tx-XMPP v0.15 to retrieve original `str` value, so this now used to build the hash.
fix 486
XMPP Decentralized ID (XID) implementation. All the spec but private key synchronisation
is implemented, and private key can be synchronised with import/export method which
through a URI usable with QR Code as explained in the spec.
rel 477
- Use `client` instead of `profile`
- Add `decrypt_value_by_profile` which is notably useful on client startup, when the
encrypted password needs to be retrieved, and the `SatXMPPEntity` instance is not yet
created.
- Add type hints/update docstrings
rel 477
Fix embedded bridge and adapt to changes in core code:
- Add `EmbeddedBridgeSettings` so it can be used in settings.
- Add `AIOBridge` and `TwistedBridge` wrappers.
- Fix callbacks, instead of logging them (and breaking the errback chain), they are now
raised using `BridgeException` like in other bridges.
- Ensure that a singleton `Bridge` is used between backend and frontend.
- Init backend on first call to `bridge_connect`.
- Add Python 3.14 fix (as it is normally done in Launcher which is not run with with
`embedded`, we have to do it there).
- Track generated files.
To improve connection time and UX in frontends, the `start_connection` returns immediately
after the connection is established (authentication successful), and the rest of
initialisation is now done in background. The `profile_ready` and
`profile_connection_error` signals can be used to track the end of the full connection
process.
Roster retrieval is now also done in background for the same reason.
`LiberviaRosterProtocol.got_roster` Deferred can be used to track roster retrieval.
XEP-0033 may be used as a simple metadata marker when sending messages (e.g. to indicate a
`replyto`). The validation was failing on that due to missing `to`, `cc` and `bcc`.
When returning pending queries `Deferred`, a caller could add its own callbacks/errbacks
and modify the result. When another caller was reusing the `Deferred`, it got the modified
result (which could be `None`) instead of the expected `DiscoInfo`.
This has been fixed by creating and new `Deferred` on each request, and chaining it to the
original pending queries using the new `fork_deferred` helper method, so each caller get
its own isolated `Deferred`.
In `fork_deferred`, `cancel` method is used to call the parent Deferred `cancel`, to avoid
a wrong Exception propagation and the chained Deferred to be eventually called twice
(triggering `AlreadyCalledError`).
`cleanup_query` has been moved above `infos_cb` callback, as it should be the first
callback called.
- Avatar disabling was not correctly handled for all cases, this should now be fixed.
- Avatar retrieval is now down only on PEP events, no directly anymore. `get_avatar` only
returns cached version.
`NS_AVATAR_METADATA` is already advertised by `add_pep_event`, adding it to `getDiscoInfo`
too was resulting in double advertising, making the disco infos invalid for caching
(resulting in other devices repeatedly requesting disco#info).
When `li` stdout was redirected (e.g. with a pipe), the buffer was preventing to display
immediately data, which is a problem when we need it immediately (like when monitoring
with `li debug monitor`). Flushing is now done immediately to avoid that.
The plugin was trying to decrypt all pubsub events, without checking if there is
"encrypted" element first, resulting in warning for all clear events.
This patch fixes it by detecting <encrypted> element and exiting early if none is found.
When caps node was requested, disco infos was returned from cache + infos from normal
disco gathering, resulting in doubled items and other entities rejecting the disco info.
This is fixed by subclassing the disco handler to add a trigger. This trigger is used by
XEP-0115 to short circuit the disco gathering and returned its cached data instead.
Our own hash is re-generated on each connection, and validated, so if there is a bug, this
helps see and catch it.
"Origin" request are disco requests to know if a message sender is a bot or coming from a
gateway. It was sending request on every message, including pubsub/PEP events, resulting
in requests done to many entities, including ones not cacheables (bare entities or third
party servers, without caps mechanisms).
To avoid that, the requests is now done only for printable messages. To use
`client.is_message_printable` correctly, origin check has be moved to the end, after
`message_parse` trigger, so attachments are added to data.
When `prepare_for_profile` is called during connection init, an infinite loop could happen
with 'get_session_manager` calling `prepare_for_profile`. A check is added to early exit
if the profile is already being prepared, avoiding this issue.