Commit 9872c3c
authored
fix: provide remote servers a way to find out about an event created during the remote join handshake (#71)
### TLDR
Use a "dummy" event to tie together forward extremities, and proactively
send it to all servers in the room. This allows recently joined servers
to become aware of recent events that would otherwise have "slipped
through the cracks" and thus not be retrievable.
NOTE: While this does send the "dummy" event to all servers in the room,
regardless of if they should care or not, at some point a new event will
reference this dummy event and require it's retrieval. Since it was
proactively sent, this will now not be necessary. This assists in
preventing forks in the DAG
### Alternatives
Unlike #51 which 'pushes' the missing event directly, this causes the
event to be 'pulled' by referencing it as a `prev_event` of a dummy
event. Since the 'dummy event' does not get passed into the client, it
is effectively invisible.
Draw-backs of #51 meant it was not always certain if the 'pushed event'
would show up in `/sync` or in `/messages`, but usually was in `/sync`.
This method always has the 'missing event' show up in `/messages`, which
I feel is more technically correct as that event was(albeit just barely)
created before the 'join event' is persisted.
### The Process
The order of events:
1. `make_join` from remote server, response sent
2. Message A sent from local server
3. `send_join` from remote server, response from local server. Message A
is not in this(as it is not state and is not referenced in any events
that are included). Join event is persisted on local server.
4. Local server realizes there are two forward extremities just after
persisting the join event.
A. Creates a `org.matrix.dummy_event` that has `prev_events` containing
both the join and message A.
B. Sends this dummy event to all servers in the room.
5. Remote server receives the dummy event via it's `/send` endpoint,
saves it in a queue until the partial state join begins syncing
additional room state2 files changed
+56
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
769 | 773 | | |
770 | 774 | | |
771 | 775 | | |
| |||
806 | 810 | | |
807 | 811 | | |
808 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
809 | 834 | | |
810 | 835 | | |
811 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2210 | 2210 | | |
2211 | 2211 | | |
2212 | 2212 | | |
2213 | | - | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
2214 | 2243 | | |
2215 | 2244 | | |
2216 | 2245 | | |
| |||
2242 | 2271 | | |
2243 | 2272 | | |
2244 | 2273 | | |
2245 | | - | |
2246 | | - | |
| 2274 | + | |
2247 | 2275 | | |
2248 | 2276 | | |
2249 | 2277 | | |
| |||
0 commit comments