Conversation
Nothing consumes a caption. It arrived on an incoming protobuf pointer, went into a column, came back out as a struct field, and went back out on the wire unchanged: no client renders it, nothing searches it, no index or constraint refers to it, and the conversation-preview query already skips it deliberately. A field that only round-trips is one more column to keep positionally correct in four statements for no behaviour. Field 11 is reserved rather than deleted: clients on the network keep sending it, and the number must never be handed to anything else. The checked-in protobuf output and the generated debug printer are regenerated to match, with protoc 3.21.12 - the version that produced the existing files.
This was referenced Sep 21, 2026
Author
|
Closing as already part of attachment-availability |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
captionon an attachment was a pure pass-through with no consumer, so this removes it end to end.What goes
OutgoingAttachment::captionandAttachment::caption(include/session/client/attachment.hpp)caption TEXTcolumn onmessage_attachmentsinfull_schema.sql, plus a new migrationsrc/client/schema/006_drop_attachment_caption.sqldropping it from existing databasessrc/client/client.cppthat carried it: the attachment read, the outgoing write, the outgoing protobuf build, and the incoming writeoptional string caption = 11inAttachmentPointertests/test_client/attachments.cpp(the tests shrink; none are deleted)Why it is safe
Nothing reads it. It went protobuf in -> column -> struct field -> column -> protobuf out and nowhere else: no client renders it, nothing searches on it, and it has no index, default or foreign key. The conversation-preview query in
client.cppalready excludes it on purpose and says so in a comment.Removing it also takes four positional statements down by one column each, which is four fewer places for a template parameter list, a
?count and a structured binding to drift apart.Field 11 is reserved, not freed
AttachmentPointergains its firstreservedblock:Old clients on the network keep sending field 11, so the number must never be reused - anything assigned to it later would parse their captions as its own data. This PR deliberately does not touch any other field number.
Protobuf regeneration
proto/SessionProtos.pb.h,proto/SessionProtos.pb.ccandproto/debug_print.cppare checked in and are not generated at build time, so they are regenerated here with protoc 3.21.12, the version that produced the existing committed files (WebSocketResources.pb.*regenerates byte-identical, confirming the match). Outside the caption accessors the only churn is the expected_has_bits_renumbering for the fields after 11.Verification
On top of session-foundation#168 (
a8a81514):testAllgreen: 405 test cases, 25,758,663 assertions, including all 47[attachments]casestests/schema_history_check.shwalks this commit, Attachment availability: say what we hold of a file, and tell everyone showing it session-foundation/libsession-util#168's tip and the currentclienttip, and all three upgrade cleanly through the new migrationEach of the four positional statements was re-derived against the post-session-foundation#168 code rather than replayed, since session-foundation#168 added
unavailableandcachedtomessage_attachmentsand changed the load query. Recounted by hand afterwards: the attachment read is 12 columns / 12 bindings / 12 template parameters, the outgoing write 8 / 8 / 8, the outgoing protobuf build 8 / 8 / 8, and the incoming write 12 / 12 / 12.One pre-existing failure further back in the schema-history walk is untouched by this branch: a database from
3df4ae52(v1.8.0-408) does not reach today's schema because of the group-memberstateCHECK constraints. It reproduces identically on a pristineclientbuild, so it is unrelated to this change and to session-foundation#168.