Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation Sitching #1432

Merged
merged 42 commits into from
Dec 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5938aeb
migration
codabrink Dec 18, 2024
b250d02
Fill the column
codabrink Dec 18, 2024
334c066
wip
codabrink Dec 18, 2024
9b894b5
adjust column
codabrink Dec 18, 2024
7d1f8d9
adjust default
codabrink Dec 18, 2024
13031f8
efficient derivation
codabrink Dec 18, 2024
95639d9
use a trait
codabrink Dec 18, 2024
865506d
fix the migration
codabrink Dec 18, 2024
1438028
minor fixes
codabrink Dec 18, 2024
91388a7
update welcome
codabrink Dec 18, 2024
1873e99
use the concrete type
codabrink Dec 18, 2024
e4e2e87
cleanup
codabrink Dec 19, 2024
eb44a15
Merge branch 'main' into coda/stitching
codabrink Dec 19, 2024
825b83f
remove the builder
codabrink Dec 19, 2024
d4d3d30
Merge branch 'coda/stitching' of github.com:xmtp/libxmtp into coda/st…
codabrink Dec 19, 2024
037b8de
update the query
codabrink Dec 19, 2024
d155744
comment
codabrink Dec 19, 2024
0f5c726
subquery
codabrink Dec 19, 2024
be69a8d
need those inbox ids to be different
codabrink Dec 19, 2024
e7f933b
test
codabrink Dec 19, 2024
4c72ddc
cleanup
codabrink Dec 19, 2024
9cefbc5
cleanup
codabrink Dec 19, 2024
17f534e
lint
codabrink Dec 19, 2024
75c9f0d
Update xmtp_mls/migrations/2024-12-18-170645_add_dm_id/up.sql
codabrink Dec 20, 2024
3dfef1f
better test
codabrink Dec 20, 2024
fa4c810
test the timestamp
codabrink Dec 20, 2024
55644b8
cleanup
codabrink Dec 20, 2024
4959fbe
move comment
codabrink Dec 20, 2024
e820767
more cleanup
codabrink Dec 20, 2024
a287b35
test it
codabrink Dec 20, 2024
e70abb2
Merge remote-tracking branch 'origin/main' into coda/stitching
codabrink Dec 20, 2024
5477865
wasm
codabrink Dec 20, 2024
14693de
Merge remote-tracking branch 'origin/main' into coda/stitching
codabrink Dec 20, 2024
b234f27
test fix
codabrink Dec 20, 2024
918d9da
test fix
codabrink Dec 20, 2024
c8c6f5b
Merge branch 'main' into coda/stitching
codabrink Dec 20, 2024
3dbcd67
fix migration headaches
codabrink Dec 20, 2024
70ac2b4
fix
codabrink Dec 20, 2024
ab0acf1
lint
codabrink Dec 20, 2024
f375274
add option to include duplicate dms
codabrink Dec 20, 2024
9ed24e7
Merge remote-tracking branch 'origin/main' into coda/stitching
codabrink Dec 21, 2024
04ad4ed
lint
codabrink Dec 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
migration
codabrink committed Dec 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 5938aeb9c31dbc44d7b6541e0974d7f7749d21b9
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions xmtp_mls/migrations/2024-12-18-170645_add_dm_id/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE groups DROP COLUMN dm_id;
ALTER TABLE groups DROP COLUMN last_message_ns;

DROP TRIGGER IF EXISTS msg_inserted;
11 changes: 11 additions & 0 deletions xmtp_mls/migrations/2024-12-18-170645_add_dm_id/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE groups ADD COLUMN dm_id TEXT;
ALTER TABLE groups ADD COLUMN last_message_ns BIGINT;

-- Create a trigger to auto-update group table on insert;
CREATE TRIGGER msg_iserted
codabrink marked this conversation as resolved.
Show resolved Hide resolved
AFTER INSERT ON group_messages
BEGIN
UPDATE groups
SET last_message_ns = (strftime('%s', 'now') * 1000000000) + (strftime('%f', 'now') * 1000000)
WHERE id = NEW.group_id;
END;
2 changes: 2 additions & 0 deletions xmtp_mls/src/storage/encrypted_store/schema.rs
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ diesel::table! {
dm_inbox_id -> Nullable<Text>,
nplasterer marked this conversation as resolved.
Show resolved Hide resolved
rotated_at_ns -> BigInt,
conversation_type -> Integer,
dm_id -> Nullable<Text>,
last_message_ns -> Nullable<BigInt>,
}
}