This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Commit 0f971ca
authored
Update `get_pdu` to return the untouched, pristine `EventBase` as it was originally seen over federation (no metadata added). Previously, we returned the same `event` reference that we stored in the cache which downstream code modified in place and added metadata like setting it as an `outlier` and essentially poisoned our cache. Now we always return a copy of the `event` so the original can stay pristine in our cache and re-used for the next cache call.
Split out from #13205
As discussed at:
- #13205 (comment)
- #13205 (comment)
Related to #12584. This PR doesn't fix that issue because it hits [`get_event` which exists from the local database before it tries to `get_pdu`](https://github.com/matrix-org/synapse/blob/7864f33e286dec22368dc0b11c06eebb1462a51e/synapse/federation/federation_client.py#L581-L594).
1 parent a1b62af commit 0f971ca
File tree
5 files changed
+233
-61
lines changed- changelog.d
- synapse
- federation
- handlers
- storage/databases/main
- tests/federation
5 files changed
+233
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
312 | | - | |
| 313 | + | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
361 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
362 | 365 | | |
363 | | - | |
364 | | - | |
365 | | - | |
| 366 | + | |
366 | 367 | | |
367 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
368 | 399 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 400 | + | |
375 | 401 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
383 | 405 | | |
384 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
385 | 409 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
399 | 434 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 435 | + | |
| 436 | + | |
404 | 437 | | |
405 | | - | |
406 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
407 | 446 | | |
408 | | - | |
| 447 | + | |
409 | 448 | | |
410 | 449 | | |
411 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
773 | 787 | | |
774 | 788 | | |
775 | 789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1346 | 1346 | | |
1347 | 1347 | | |
1348 | 1348 | | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1349 | 1355 | | |
1350 | 1356 | | |
1351 | | - | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
1352 | 1367 | | |
1353 | 1368 | | |
1354 | 1369 | | |
| |||
1358 | 1373 | | |
1359 | 1374 | | |
1360 | 1375 | | |
1361 | | - | |
1362 | 1376 | | |
1363 | 1377 | | |
1364 | 1378 | | |
| |||
1369 | 1383 | | |
1370 | 1384 | | |
1371 | 1385 | | |
1372 | | - | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
1373 | 1390 | | |
1374 | 1391 | | |
1375 | 1392 | | |
| |||
0 commit comments