Skip to content

Commit

Permalink
Editorial: clarify Receiving a Push Message
Browse files Browse the repository at this point in the history
This makes it more clearly talk about bytes rather than plain text. It also turns a redundant requirement into a statement of fact.
  • Loading branch information
annevk authored Sep 3, 2024
1 parent 3a1f3d6 commit 53fc465
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ <h2>
};
</pre>
<p>
<a>PushMessageData</a> objects have an associated <dfn>bytes</dfn> (a [=byte sequence=]),
{{PushMessageData}} objects have an associated <dfn>bytes</dfn> (a [=byte sequence=]),
which is set on creation.
</p>
<p>
Expand Down Expand Up @@ -1123,32 +1123,29 @@ <h2>
</li>
<li>Let |subscription| be the active <a>push subscription</a> for |registration|.
</li>
<li>Initialize |data| to a value of `null`.
<li>Let |bytes| be null.
</li>
<li>If the <a>push message</a> contains a payload, perform the following steps:
<li>If the <a>push message</a> contains a payload:
<ol>
<li>Decrypt the <a>push message</a> using the private key from the key pair
associated with |subscription| and the process described in [[RFC8291]]. This
produces the plain text of the message.
<li>Decrypt the <a>push message</a> payload using the private key from the key pair
associated with |subscription| and the process described in [[RFC8291]]. Set |bytes|
to the resulting [=/byte sequence=].
</li>
<li>If the <a>push message</a> could not be decrypted for any reason, perform the
following steps:
<li>If the <a>push message</a> payload could not be decrypted for any reason:
<ol>
<li>Acknowledge the receipt of the <a>push message</a> according to [[RFC8030]].
Though the message was not successfully received and processed, this prevents the
push service from attempting to retransmit the message; a badly encrypted message
is not recoverable.
</li>
<li>Discard the <a>push message</a>.
<li>Abort these steps.
</li>
<li>Terminate this process.
</li>
</ol>A `push` event MUST NOT be fired for a <a>push message</a> that was not
successfully decrypted using the key pair associated with the <a>push
subscription</a>.
</li>
<li>Let |data| be a new <a>PushMessageData</a> instance with the decrypted plain text
of the <a>push message</a>.
</ol>
<p class="note">
A `push` event will not be fired for a <a>push message</a> that was not
successfully decrypted using the key pair associated with the <a>push
subscription</a>.
</p>
</li>
</ol>
</li>
Expand All @@ -1162,7 +1159,7 @@ <h2>
`data`
</dt>
<dd>
|data|
A new {{PushMessageData}} object whose [=bytes=] is |bytes|.
</dd>
</dl>
<p>
Expand Down

0 comments on commit 53fc465

Please sign in to comment.