Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
e50f2864
Unverified
Commit
e50f2864
authored
4 years ago
by
Timo Kösters
Browse files
Options
Downloads
Patches
Plain Diff
improvement: save state for send_join pdu
parent
e305889b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client_server/membership.rs
+8
-0
8 additions, 0 deletions
src/client_server/membership.rs
src/database/rooms.rs
+0
-1
0 additions, 1 deletion
src/database/rooms.rs
with
8 additions
and
1 deletion
src/client_server/membership.rs
+
8
−
0
View file @
e50f2864
...
@@ -650,6 +650,10 @@ async fn join_room_by_id_helper(
...
@@ -650,6 +650,10 @@ async fn join_room_by_id_helper(
db
.rooms
.add_pdu_outlier
(
&
pdu
)
?
;
db
.rooms
.add_pdu_outlier
(
&
pdu
)
?
;
}
}
// We append to state before appending the pdu, so we don't have a moment in time with the
// pdu without it's state. This is okay because append_pdu can't fail.
let
statehashid
=
db
.rooms
.append_to_state
(
&
pdu
,
&
db
.globals
)
?
;
db
.rooms
.append_pdu
(
db
.rooms
.append_pdu
(
&
pdu
,
&
pdu
,
utils
::
to_canonical_object
(
&
pdu
)
.expect
(
"Pdu is valid canonical object"
),
utils
::
to_canonical_object
(
&
pdu
)
.expect
(
"Pdu is valid canonical object"
),
...
@@ -658,6 +662,10 @@ async fn join_room_by_id_helper(
...
@@ -658,6 +662,10 @@ async fn join_room_by_id_helper(
&
[
pdu
.event_id
.clone
()],
&
[
pdu
.event_id
.clone
()],
db
,
db
,
)
?
;
)
?
;
// We set the room state after inserting the pdu, so that we never have a moment in time
// where events in the current room state do not exist
db
.rooms
.set_room_state
(
&
room_id
,
statehashid
)
?
;
}
else
{
}
else
{
let
event
=
member
::
MemberEventContent
{
let
event
=
member
::
MemberEventContent
{
membership
:
member
::
MembershipState
::
Join
,
membership
:
member
::
MembershipState
::
Join
,
...
...
This diff is collapsed.
Click to expand it.
src/database/rooms.rs
+
0
−
1
View file @
e50f2864
...
@@ -1115,7 +1115,6 @@ pub fn build_and_append_pdu(
...
@@ -1115,7 +1115,6 @@ pub fn build_and_append_pdu(
// pdu without it's state. This is okay because append_pdu can't fail.
// pdu without it's state. This is okay because append_pdu can't fail.
let
statehashid
=
self
.append_to_state
(
&
pdu
,
&
db
.globals
)
?
;
let
statehashid
=
self
.append_to_state
(
&
pdu
,
&
db
.globals
)
?
;
// remove the
self
.append_pdu
(
self
.append_pdu
(
&
pdu
,
&
pdu
,
pdu_json
,
pdu_json
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment