Commit graph libervia-backend/libervia/backend/memory/migration/versions
Author SHA1 Message Date
Goffi
399802455f memory (sqla_mapping): Add index on PrivateInd* tables:
`PriaveInd*` may be queried without `key`, in which case an index was missing.
2026-05-02 15:55:18 +02:00
Goffi
42c2f88b30 component pubsub: PEP presence access model and auto-subscription
- Implement `presence` access model for PEP nodes.
- Add PEP auto-subscription (`+notify` handling)
- New `get_pep_last_items` storage method to retrieve in a single query items to send to
  auto-subscribers.
- Online resource tracking.

This completes the PEP support.

rel 476
2026-04-15 20:51:51 +02:00
Goffi
3aa58e73dc memory (sqla): new pep column in PubsubNode:
This column can be used for quick filtering on PEP nodes.

rel 476
2026-04-14 23:10:19 +02:00
Goffi
da2c2c49ea component pubsub: Implement "max_items":
A new `max_items` field has been added to `PubsubNode`. `0` means `max`. If any >0 value
is used, items will be automatically deleted by `cache_pubsub_items`. Items are currently
discarded (i.e. no notification is sent), this is the same behaviour as in legacy Libervia
Pubsub (formerly "SàT Pubsub").

rel 476
2026-04-11 12:47:40 +02:00
Goffi
c89b91c2e9 component pubsub: Integrate XEP-0499 extended discovery:
- Added `on_extended_disco()` handler.
- Added `with_parent=True` to all `get_pubsub_node()` calls to prevent lazy load errors in
  access checks.

rel 476

Registered XEP-0499 handler in `profile_connecting()` and added it to
plugin dependencies.
2026-04-11 12:46:47 +02:00
Goffi
82e2c6efac apply black to the whole codebase. 2026-03-09 09:22:04 +01:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
e593f32f09 memory (sqla): add "parent_node_id" and "linked_mode_id" to PubsubNode:
This is to prepare for the implementation of XEP-0496 and XEP-0499.

rel 463
2025-08-29 17:59:12 +02:00
Goffi
26002870a8 memory (sqla): Add columns and tables to handles permissions:
Add columns to handle `access_model` and `publish_model` and a table for `affiliations`.
With those new data, components handling pubsub can now manage permissions correctly.

rel 462
2025-08-03 23:45:45 +02:00
Goffi
f2075750ed storage (mapping): Fix nullable for thread ID, and add a is_retroactive field:
`is_retroactive` is used to link a thread in a parent message when it didn't have the
thread initially.

rel 457
2025-05-06 00:21:24 +02:00
Goffi
764352afc7 storage: Add missing migration script to use JSON type instead of TEXT in History and private binary data. 2025-05-06 00:19:43 +02:00
Goffi
53fdaa9d09 Reformatted code base using black. 2024-06-19 18:44:57 +02:00
Goffi
188c2c97ba migration: fix migration when XEP-0373 or XEP-0384 can't be imported:
Those plugins are using optional modules, and if their importation fails, there is
probably no data to migrate either.
2024-03-09 15:13:14 +01:00
Goffi
3694bb3991 core (memory/migration):
Update XEP-0384 and `fe3a02cb4bec_convert_legacypickle_columns_to_json.py` migration to
properly handle (de)serialisation of `TrustMessageCacheEntry`.
2024-03-05 17:31:12 +01:00
Goffi
a8348576ae core: get rid of pickle:
Use of `pickle` to serialise data was a technical legacy that was causing trouble to store
in database, to update (if a class was serialised, a change could break update), and to
security (pickle can lead to code execution).

This patch remove all use of Pickle in favour in JSON, notably:
- for caching data, a Pydantic model is now used instead
- for SQLAlchemy model, the LegacyPickle is replaced by JSON serialisation
- in XEP-0373 a class `PublicKeyMetadata` was serialised. New method `from_dict` and
  `to_dict` method have been implemented to do serialisation.
- new methods to (de)serialise data can now be specified with Identity data types. It is
  notably used to (de)serialise `path` of avatars.

A migration script has been created to convert data (for upgrade or downgrade), with
special care for XEP-0373 case. Depending of size of database, this migration script can
be long to run.

rel 443
2024-02-23 13:31:04 +01:00
Goffi
5bb47c69e4 core (memory/sqla_mapping): add a version_id column to detect race conditions. 2023-11-22 14:52:00 +01:00
Goffi
b74f55d73d core: notifications implementation, first draft:
add a new table for notifications, and methods/bridge methods to manipulate them.
2023-10-16 17:29:31 +02:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00