No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0310.xml 13KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Presence State Annotations</title>
  10. <abstract>This document provides a protocol using which a server is able to provide information to clients indicating that previously received presence data may be stale.</abstract>
  12. <number>0310</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>PSA</shortname>
  23. &ksmithisode;
  24. <revision>
  25. <version>0.1</version>
  26. <date>2012-01-10</date>
  27. <initials>psa</initials>
  28. <remark><p>Initial published version.</p></remark>
  29. </revision>
  30. <revision>
  31. <version>0.0.1</version>
  32. <date>2012-01-03</date>
  33. <initials>kis</initials>
  34. <remark><p>Initial published version.</p></remark>
  35. </revision>
  36. </header>
  37. <section1 topic='Introduction' anchor='intro'>
  38. <p>Presence data received by a client &xmppim; are typically cached and displayed until they are replaced by an update (whereupon the new data will be cached and displayed...), for example graphically annotating availability of contacts in a roster. Where the entity from which the client has received the presence data is remote (residing upon a different server), unavailability of the server to server link will render the client unable to receive further presence updates from the entity but unaware that this is the case. Where the remote entity is a contact, it may cause the contact appear to be online (or offline, or away etc.) to the user of the client when they are not. Where the remote entity is a &xep0045; room the case is more severe, as the MUC room may have ejected the client due to the server-to-server (S2S) link being unavailable to send stanzas but the client may still consider itself present in the room.</p>
  39. <p>This extension provides a simple mechanism by which the local server can resend previous presence data to the client, annotated such that the client knows it would be unable to receive future updates.</p>
  40. </section1>
  41. <!-- Appropriate action - alert user, attempt to rejoin MUC, whatever. -->
  42. <section1 topic='Requirements' anchor='reqs'>
  43. <p>Allow servers to annotate presence stanzas sent to clients indicating lack of availability of a client or server link necessary for receipt of updated presence.</p>
  44. </section1>
  45. <section1 topic='Discovery' anchor='discovery'>
  46. <p>Clients supporting this should have a feature of "urn:xmpp:psa" in caps. Servers autoenable based on this.</p>
  47. </section1>
  48. <section1 topic='Use Cases' anchor='usecases'>
  49. <p>There are three main cases that links may be unavailable, leading to Romeo (a user of the montague.lit server) receiving presence state annotations:</p>
  50. <ul>
  51. <li>That a connection from montague.lit to a remote server, such as capulet.lit, is unavailable, leading to remote presence from users on capulet.lit (e.g. juliet@capulet.lit) being potentially stale.</li>
  52. <li>That a connection from a client to montague.lit has been paused (e.g. because the client uses Stream Management and has a ready-to-resume session, or has a paused BOSH session), such that Romeo's representation of a paused session such as benvolio@montague.lit's is not accurate.</li>
  53. <li>That the connection between a MUC room in which Romeo is an occupant and another of that room's occupants is affected by either of the cases above, making Romeo's view of the room occupancy stale.</li>
  54. </ul>
  55. <p>Here we address each in turn. In each of these examples Romeo's client is assumed to have already indicated support for PSAs, as described in 'discovery' above.</p>
  56. <section2 topic='Remote Server Unavailable' anchor='s2s'>
  57. <p>In this example, Romeo (romeo@montague.lit) has received presence from Juliet (juliet@capulet.lit/orchard), either because she's in his roster or because she sent directed presence.</p>
  58. <example caption="Romeo receives Juliet's presence" ><![CDATA[
  59. <presence
  60. from='juliet@capulet.lit/orchard'
  61. to='romeo@montague.lit/lane'>
  62. <status>Available</status>
  63. </presence>
  64. ]]></example>
  65. <p>The server to server connection between capulet.lit and montague.lit then becomes unavailable for some reason (montague.lit can't know if this is a network error, a server failure, or some other condition). Juliet may now be updating her presence (e.g. she might now have gone offline), and Romeo would not be able to receive the presence update stanzas. As such, montague.lit MUST push the old presence to Romeo, annotated that this may now be stale due to an s2s outage.</p>
  66. <p>The state-annotation element alerts Romeo's client to the unavailability of the server link through the server-unavailable child. The state-annotation MUST have a 'from' attribute set to the entity annotating the stanza (in this case montague.lit), and an OPTIONAL description child MAY provide human-readable text describing the change.</p>
  67. <example caption="Romeo receives Juliet's presence, annotated that the S2S is unavailable" ><![CDATA[
  68. <presence
  69. from='juliet@capulet.lit/orchard'
  70. to='romeo@montague.lit/lane'>
  71. <status>Available</status>
  72. <state-annotation xmlns="urn:xmpp:psa" from="montague.lit">
  73. <server-unavailable/>
  74. <description>The capulet.lit server is no longer available</description>
  75. </state-annotation>
  76. </presence>
  77. ]]></example>
  78. <p>When the link between montague.lit and capulet.lit again becomes available, montague.lit MUST send an empty annotation of the previous presence to Romeo. It MAY subsequently attempt to refresh this presence by reprobing the remote entity.</p>
  79. <example caption="Romeo receives Juliet's annotated presence, annotated that S2S is restored" ><![CDATA[
  80. <presence
  81. from='juliet@capulet.lit/orchard'
  82. to='romeo@montague.lit/lane'>
  83. <status>Available</status>
  84. <state-annotation xmlns="urn:xmpp:psa" from="montague.lit"/>
  85. </presence>
  86. ]]></example>
  87. <p>When an S2S connection is deemed not to be available, or to return to availability afterwards (TODO: guidelines on what this means), the server MUST send a corresponding annotated presence for every remote full JID on the unavailable server to every local client requesting PSAs where the local client has received presence from the remote JID and the most recent presence is an available type (i.e. not error or unavailable). Subscription requests are excluded from this processing.</p>
  88. </section2>
  89. <section2 topic='Local User Paused' anchor='connectionpaused'>
  90. <p>In this example, Romeo (romeo@montague.lit) has received presence from Benvolio (benvolio@montague.lit/lane), who is using BOSH.</p>
  91. <example caption="Romeo receives Benvolio's presence" ><![CDATA[
  92. <presence
  93. from='benvolio@montague.lit/lane'
  94. to='romeo@montague.lit/lane'>
  95. <status>He ran this way, and leap'd this orchard wall</status>
  96. </presence>
  97. ]]></example>
  98. <p>Benvolio's client then uses the BOSH 'pause' feature for suspending the session. The montague.lit server MUST then send an annotated presence to Romeo's client saying that Benvolio's session has been paused. This MUST include the connection-paused element, MUST include a 'from' attribute of the entity doing the annotating (montague.lit) and MAY include a human-readable description element</p>
  99. <example caption="Romeo receives Benvolio's presence annotated for the paused session" ><![CDATA[
  100. <presence
  101. from='benvolio@montague.lit/lane'
  102. to='romeo@montague.lit/lane'>
  103. <state-annotation xmlns="urn:xmpp:psa" from="montague.lit">
  104. <connection-paused/>
  105. <description>benvolio's BOSH session has been paused</description>
  106. </state-annotation>
  107. <status>He ran this way, and leap'd this orchard wall</status>
  108. </presence>
  109. ]]></example>
  110. <p>After pausing the session, Benvolio's client can either resume it or allow it to time out. If the session is resumed, the server MUST send an empty state-annotation to Romeo's client. If the session times out, it will simply send an unavailable presence as normal.</p>
  111. <example caption="Romeo receives Benvolio's presence annotated for the resumed session" ><![CDATA[
  112. <presence
  113. from='benvolio@montague.lit/lane'
  114. to='romeo@montague.lit/lane'>
  115. <state-annotation xmlns="urn:xmpp:psa" from="montague.lit"/>
  116. <status>He ran this way, and leap'd this orchard wall</status>
  117. </presence>
  118. ]]></example>
  119. <example caption="Romeo receives Benvolio's synthesized unavailable presence for the terminated session" ><![CDATA[
  120. <presence
  121. from='benvolio@montague.lit/lane'
  122. to='romeo@montague.lit/lane' type='unavailable'/>
  123. ]]></example>
  124. <p>When a server detects that a client's session has been temporarily suspended (either through a BOSH pause, or through a disconnection while using 198 prior to the resume period timing out) it MUST send annotated presence, as above, to every local and remote JID that has received the client session's presence (and where the presence is not subscription-related and has not been cancelled by a corresponding unavailable presence) and requests PSAs. If a paused session is resumed, the server MUST then send a corresponding empty state-annotation to each of these JIDs, as above. If the session is terminated the server MUST send unavailable presence using the usual rules from RFC6121.</p>
  125. </section2>
  126. <section2 topic='MUC loses contact with occupant' anchor='mucoccupant'>
  127. <p>In this example, Romeo (romeo@montague.lit) is an occupant in the orchard@chats.shakespeare.lit MUC room, alongside Juliet (juliet@capulet.lit). (For these examples, the usual MUC payloads are elided; they should be present as required by xep45).</p>
  128. <example caption="Romeo receives a presence update from Juliet in the MUC room" ><![CDATA[
  129. <presence
  130. from='orchard@chats.shakespeare.lit/Juliet'
  131. to='romeo@montague.lit/lane'>
  132. <status>Ay me!</status>
  133. </presence>
  134. ]]></example>
  135. <p>Some time later, the MUC service chats.shakespeare.lit loses server to server connectivity to capulet.lit (the server upon which Juliet's account resides). If the server does not immediately remove Juliet as an occupant of the room, it MUST send Romeo an annotated presence, following the rules for server-unavailable defined above in s2s.</p>
  136. <example caption="Romeo receives an annotated presence from the MUC room that Juliet's server is unavailable" ><![CDATA[
  137. <presence
  138. from='orchard@chats.shakespeare.lit/Juliet'
  139. to='romeo@montague.lit/lane'>
  140. <state-annotation xmlns="urn:xmpp:psa" from="chats.shakespeare.lit">
  141. <server-unavailable/>
  142. <description>The user's server is no longer reachable</description>
  143. </state-annotation>
  144. <status>Ay me!</status>
  145. </presence>
  146. ]]></example>
  147. <p>If the S2S link becomes available and the MUC service has not yet ejected Juliet from the room, it MUST send an empty state-annotation to indicate this. If, instead, it has ejected Juliet in the meantime there is no additional stanza to send (as the ejection will already have been communicated to Romeo's client following the rules in xep45).</p>
  148. <example caption="Romeo receives an annotated presence from the MUC room that Juliet's server is again available" ><![CDATA[
  149. <presence
  150. from='orchard@chats.shakespeare.lit/Juliet'
  151. to='romeo@montague.lit/lane'>
  152. <state-annotation xmlns="urn:xmpp:psa" from="chats.shakespeare.lit"/>
  153. <status>Ay me!</status>
  154. </presence>
  155. ]]></example>
  156. </section2>
  157. </section1>
  158. <section1 topic='Business Rules' anchor='rules'>
  159. <ul>
  160. <li>When getting 'available again' for a remote MUC, MAY message yourself in the MUC and rejoin if not present.</li>
  161. <li>When MUC service re-establishes S2S, may send a probe to see if remote client is still online.</li>
  162. </ul>
  163. </section1>
  164. <!--<section1 topic='Implementation Notes' anchor='impl'>
  165. <p>OPTIONAL.</p>
  166. </section1>
  167. <section1 topic='Accessibility Considerations' anchor='access'>
  168. <p>OPTIONAL.</p>
  169. </section1>
  170. <section1 topic='Internationalization Considerations' anchor='i18n'>
  171. <p>OPTIONAL.</p>
  172. </section1>-->
  173. <section1 topic='Security Considerations' anchor='security'>
  174. <p>Although this involves sending stanzas on behalf of another entity, these are always sent by entities that are already within trust domains able to spoof such stanzas (e.g. the local server sending to a local user, or a remote server sending on behalf of its local users).</p>
  175. </section1>
  176. <section1 topic='IANA Considerations' anchor='iana'>
  177. <p>None.</p>
  178. </section1>
  179. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  180. <p>Needs a namespace.</p>
  181. </section1>
  182. <section1 topic='XML Schema' anchor='schema'>
  183. <p>When advanced.</p>
  184. </section1>
  185. </xep>