Guard against outdated Updates
It is possible for an earlier Update to be received by us later.
For this, we now
(1) only allows Updates to poll counts if there is no updated field,
or the updated field is the same as the last updated date or
creation date;
(2) does not allow updating anything if the updated field
is older than the last updated date or creation date;
(3) allows updating updatable fields otherwise (normal updates);
(4) if only the updated field is changed, it does not create
a new history item on its own.
This commit is contained in:
parent
f84ed44cea
commit
069554e925
3 changed files with 145 additions and 18 deletions
|
|
@ -1596,7 +1596,7 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||
clear_config([:instance, :federating], true)
|
||||
|
||||
with_mock Pleroma.Web.Federator,
|
||||
publish: fn p -> nil end do
|
||||
publish: fn _p -> nil end do
|
||||
{:ok, updated} = CommonAPI.update(user, activity, %{status: "updated 2 :#{emoji2}:"})
|
||||
|
||||
assert updated.data["object"]["content"] == "updated 2 :#{emoji2}:"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue