Sorry that this got buried in my mailbox and I didn’t notice it.

On 17 Nov 2018, at 16:32, Georg Lukas <[email protected]> wrote:
> when correcting a previously corrected message, do you reference the
> original message @id or the message @id of the last correction to that
> message?

It’s the original message @id - if you follow the rules in the XEP then the 
other way around wouldn’t work. This is meant to be covered by "A single 
message may be corrected multiple times by subsequent edits.” - i.e. you are 
correcting the original message multiple times, not correcting multiple 
messages once each, but I can see that’s causing confusion.

The main reason that it won’t work if you try to correct the id of the 
correction, but otherwise follow the XEP as-written, is that you lose the 
context of what you’re correcting. If you do this the ‘right’ way, you have the 
following flow (hopefully the shorthand is clear):

The original message:
<m id=1><b>typo 1</b></m>

The first correction:
<m id=2><b>typo 2</b><r id=1/></m>

So now you take the second message, with the replace body, apply the "The 
receiving client then treats the newly received payloads as completely 
replacing all payloads of the original message” rule, and you logically have a 
history that reads like:

<m id=1><b>typo 2</b></m>
<m id=2><b>typo 2</b><r id=1/></m>

Where message2 could now be binned, because it’s done its job, but is otherwise 
ignored.
Now for the second correction:
<m id=3><b>fixed</b><r id=1/></m>

And now you similarly have an updated logical history of:

<m id=1><b>fixed</b></m>
<m id=2><b>typo 2</b><r id=1/></m>
<m id=3><b>fixed</b><r id=1/></m>

Where, again, 2 and 3 can be forgotten, or simply ignored.

Everything is happy.

If you try it the other way, however, you lose the context of the original 
message because of the ‘replace all payloads’ rule.

The original message:
<m id=1><b>typo 1</b></m>
The first correction:
<m id=2><b>typo 2</b><r id=1/></m>

New logical history:
<m id=1><b>typo 2</b></m>
<m id=2><b>typo 2</b><r id=1/></m>

Second correction:
<m id=3><b>fixed</b><r id=2/></m>

So, under this scheme,  now we’re going to replace all the payloads of message 
2 with the corrected payloads from message 3, so we have a new logical history 
state of:

<m id=1><b>typo 2</b></m>
<m id=2><b>fixed</b></m>
<m id=3><b>fixed</b><r id=2/></m>

which is certainly not what we want.

> <snip/>
> It would be great to clarify in the XEP business rules.

I did that. It would be great if you didn’t -1 the clarification :p
If there’s a better way for me to express the clarification, please do shout, 
but I do think that PR or something similar needs to be merged so we can avoid 
this confusion.

/K
_______________________________________________
Standards mailing list
Info: https://mail.jabber.org/mailman/listinfo/standards
Unsubscribe: [email protected]
_______________________________________________

Reply via email to