perf: sync protocol and core hardening updates
This commit is contained in:
parent
152fed3b87
commit
4390ebf5a9
283 changed files with 29231 additions and 2295 deletions
12
deploy/migrations/0075_uploaded_media_receipts.up.sql
Normal file
12
deploy/migrations/0075_uploaded_media_receipts.up.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- upload.saveFilePart data is transient, while messages.sendMedia may be replayed after its first
|
||||
-- response is lost. Preserve the immutable Photo/Document materialization selected for each
|
||||
-- (owner,file_id) so InputMediaUploaded* remains idempotent after part cleanup.
|
||||
CREATE TABLE public.uploaded_media_receipts (
|
||||
owner_user_id bigint NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
|
||||
file_id bigint NOT NULL CHECK (file_id <> 0),
|
||||
intent_hash bytea NOT NULL CHECK (octet_length(intent_hash) = 32),
|
||||
media_kind text NOT NULL CHECK (media_kind IN ('photo', 'document')),
|
||||
media_id bigint NOT NULL CHECK (media_id <> 0),
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (owner_user_id, file_id)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue