Skip to content

Commit

Permalink
Notifications can be sent in case of terminated Relationships (#286)
Browse files Browse the repository at this point in the history
* fix: broken links

* feat: mention that Notifications can be sent on terminated Relationships

* refactor: place related sentences next to each other

* feat: mention in other scenarios queuing of Notifications

* fix: missing peerIdentity property of RelationshipDTO

* fix: wrong remark about Backbone

* feat: incorporate review comments

* feat: incorporate review comments
  • Loading branch information
britsta authored Dec 16, 2024
1 parent 236ef3c commit 02e5e20
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _docs_integrate/attribute-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ This can be done by using a suitable [Request]({% link _docs_integrate/data-mode

#### Own shared and peer shared IdentityAttributes

When [exchanging the underlying IdentityAttribute of a RepositoryAttribute with a peer](#exchange-attributes-with-peers), two corresponding copies of the RepositoryAttribute, the own shared IdentityAttribute and the peer shared IdentityAttribute, are created. This makes it possible to record with whom an IdentityAttribute has been shared or from whom an IdentityAttribute has been received. When an [IdentityAttribute]({% link _docs_integrate/data-model-overview.md %}#identityattribute) is shared by its `owner`, an own shared IdentityAttribute is created as a copy of the associated RepositoryAttribute in the wallet of the `owner`. An own shared IdentityAttribute is a [LocalAttribute]({% link _docs_integrate/data-model-overview.md %}#localattribute) for which, in contrast to the RepositoryAttribute, the `shareInfo` property is set. The `content` of the own shared IdentityAttribute is the same as that of the RepositoryAttribute. The `address` of the peer with whom the IdentityAttribute is shared is contained within its `shareInfo.peer` property. Furthermore, the `id` of the RepositoryAttribute used as the source is stored in its `shareInfo.sourceAttribute` property. This is the case as long as the RepositoryAttribute used as the source has not been [deleted]({% link _docs_integrate/delete-attributes.md %}#delete-repositoryattributes). If an IdentityAttribute is shared by its `owner` with several peers, a corresponding number of own shared IdentityAttributes are generated.
When [exchanging the underlying IdentityAttribute of a RepositoryAttribute with a peer](#attribute-management-options), two corresponding copies of the RepositoryAttribute, the own shared IdentityAttribute and the peer shared IdentityAttribute, are created. This makes it possible to record with whom an IdentityAttribute has been shared or from whom an IdentityAttribute has been received. When an [IdentityAttribute]({% link _docs_integrate/data-model-overview.md %}#identityattribute) is shared by its `owner`, an own shared IdentityAttribute is created as a copy of the associated RepositoryAttribute in the wallet of the `owner`. An own shared IdentityAttribute is a [LocalAttribute]({% link _docs_integrate/data-model-overview.md %}#localattribute) for which, in contrast to the RepositoryAttribute, the `shareInfo` property is set. The `content` of the own shared IdentityAttribute is the same as that of the RepositoryAttribute. The `address` of the peer with whom the IdentityAttribute is shared is contained within its `shareInfo.peer` property. Furthermore, the `id` of the RepositoryAttribute used as the source is stored in its `shareInfo.sourceAttribute` property. This is the case as long as the RepositoryAttribute used as the source has not been [deleted]({% link _docs_integrate/delete-attributes.md %}#delete-repositoryattributes). If an IdentityAttribute is shared by its `owner` with several peers, a corresponding number of own shared IdentityAttributes are generated.

<div style="width: 640px; height: 600px; margin: 10px; position: relative;"><iframe allowfullscreen frameborder="0" style="width:640px; height:600px" src="https://lucid.app/documents/embedded/95394e3a-b857-4165-9b1a-824ad81e04d9" id="QViE651IOP3n"></iframe></div>

Expand Down
7 changes: 4 additions & 3 deletions _docs_integrate/data-model-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ A Relationship between two Identities is the prerequisite for them to exchange M
| template | [`RelationshipTemplate`](#relationshiptemplate) | The RelationshipTemplate that was used to establish this Relationship. | |
| status | `"Pending"` \| `"Active"` \| `"Rejected"` \| `"Revoked"` \| `"Terminated"` \| `"DeletionProposed"` | The status of this Relationship. <br>{::nomarkdown}<ul><li>Pending: the Relationship was created, but not yet accepted by the recipient. In this state you cannot send Messages yet.</li><li>Active: this means that the Relationship is active. As long as it is active, both participants can exchange Messages.</li><li>Rejected: the Relationship was rejected by the recipient.</li><li>Revoked: the Relationship was revoked by the sender.</li><li>Terminated: No Messages can be sent. Either side can request reactivation from the peer.</li><li>Deletion Proposed: Your peer has decomposed the Relationship, i. e. locally deleted the Relationship and data transmitted during it.</li></ul>{:/} | |
| creationContent | [`RelationshipCreationContent`](#relationshipcreationcontent) \| [`ArbitraryRelationshipCreationContent`](#arbitraryrelationshipcreationcontent) | The content sent along when the Relationship is initiated. If the `template` contains a [RelationshipTemplateContent](#relationshiptemplatecontent), `RelationshipCreationContent` has to be used. Otherwise, an `ArbitraryRelationshipCreationContent` is used, which can be filled with anything. | will be encrypted before sent to the Backbone |
| peer | `string` | The `address` of the [Identity](#identity) with which you have this Relationship. | saved only locally |
| peerDeletionInfo | [`PeerDeletionInfo`](#peerdeletioninfo) \| `undefined` | Information about whether the Identity with which you have this Relationship is to be deleted or was deleted, as well as the point in time of that deletion. | saved only locally |
| peer | `string` | The `address` of the [Identity](#identity) with which you have this Relationship. | |
| peerIdentity | [`Identity`](#identity) | The [Identity](#identity) with which you have this Relationship. | |
| peerDeletionInfo | [`PeerDeletionInfo`](#peerdeletioninfo) \| `undefined` | Information about whether the Identity with which you have this Relationship is to be deleted or was deleted, as well as the point in time of that deletion. | |
| auditLog | [`RelationshipAuditLogEntry`](#relationshipauditlogentry)`[]` | A log of Relationship operations like creating or accepting a pending Relationship. | |

### PeerDeletionInfo
Expand Down Expand Up @@ -342,7 +343,7 @@ With the information in this type you can clearly identify the Transport object
A LocalAttribute stores the local metadata for an [Attribute](#attributes). This is contained within the `content` property of the LocalAttribute. The Attribute can be an [IdentityAttribute](#identityattribute) or a [RelationshipAttribute](#relationshipattribute). In the case of IdentityAttributes, there are three situations in which a LocalAttribute is created in the database:

- The Identity [creates an IdentityAttribute for itself]({% link _docs_integrate/create-attributes-for-yourself.md %}#create-an-identityattribute-for-yourself) (e.g. sets its first name). In particular, it is the `owner` of the IdentityAttribute. Its `shareInfo` property is undefined. Such an unshared LocalAttribute is called a **RepositoryAttribute**.
- The Identity shares an IdentityAttribute of itself with another Identity (e.g. by [exchanging]({% link _docs_integrate/attribute-introduction.md %}#exchange-attributes-with-peers) it using a suitable [Request]({% link _docs_integrate/data-model-overview.md %}#request)). In that case, a _copy_ of the RepositoryAttribute used as the source is created for which the `shareInfo` property is set. This LocalAttribute is referred to as an **own shared IdentityAttribute**.
- The Identity shares an IdentityAttribute of itself with another Identity (e.g. by [exchanging]({% link _docs_integrate/attribute-introduction.md %}#attribute-management-options) it using a suitable [Request]({% link _docs_integrate/data-model-overview.md %}#request)). In that case, a _copy_ of the RepositoryAttribute used as the source is created for which the `shareInfo` property is set. This LocalAttribute is referred to as an **own shared IdentityAttribute**.
- The Identity receives an IdentityAttribute from another Identity (e.g. receives it via a [Request]({% link _docs_integrate/data-model-overview.md %}#request)). In that case a _new_ LocalAttribute is created for which the `shareInfo` property is set. This LocalAttribute is called a **peer shared IdentityAttribute**.

In contrast, [RelationshipAttributes](#relationshipattribute) always exist in the context of a [Relationship](#relationship).
Expand Down
8 changes: 8 additions & 0 deletions _docs_integrate/delete-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ Moreover, if the peer shared Attribute had a successor, its `succeeds` property
Then, a [Notification]({% link _docs_integrate/data-model-overview.md %}#notification) with a [PeerSharedAttributeDeletedByPeerNotificationItem]({% link _docs_integrate/data-model-overview.md %}#peersharedattributedeletedbypeernotificationitem) is generated and sent to the owner of the peer shared Attribute, informing them that you deleted the Attribute they shared with you.
Consequently, the `deletionInfo` of their corresponding own shared Attribute and of all potential predecessors is updated with `deletionStatus` `"DeletedByPeer"` and the time of receiving the Notification as `deletionDate`.
In case the owner already [deleted their own shared Attribute](#delete-own-shared-attributes), nothing happens.
Please further note that the Notification is queued if the [Relationship is currently terminated]({% link _docs_integrate/terminate-relationships.md %}#terminate-an-active-relationship) but not yet [decomposed]({% link _docs_integrate/terminate-relationships.md %}#decompose-a-relationship).
It can then only be received and processed if the [Relationship is reactivated]({% link _docs_integrate/terminate-relationships.md %}#reactivate-a-terminated-relationship).
The Notification is also queued if the [peer is currently in deletion]({% link _docs_integrate/delete-identities.md %}#effects-of-identity-deletion-on-relationships) but not yet deleted.
It can then only be received and processed if the peer [cancels its deletion]({% link _docs_use-cases/use-case-transport-cancel-identitydeletionprocess.md %}).

<div style="width: 640px; height: 480px; margin: 10px; position: relative;"><iframe allowfullscreen frameborder="0" style="width:640px; height:480px" src="https://lucid.app/documents/embedded/2385af4a-4bfa-43f4-a119-afb51273194d" id="HNEl2zIWWLxc"></iframe></div>

Expand All @@ -132,6 +136,10 @@ Then, a Notification with an [OwnSharedAttributeDeletedByOwnerNotificationItem](
If they already deleted their corresponding peer shared Attribute or marked it for deletion, nothing will change.
However, if the `deletionInfo` of their peer shared Attribute was undefined before, since you didn't send a Request for Attribute deletion or the Request was rejected, a `deletionInfo` will be set.
Its `deletionStatus` will be set to `"DeletedByOwner"` and the `deletionDate` will be the time of receiving the Notification.
Please note that the Notification is queued if the [Relationship is currently terminated]({% link _docs_integrate/terminate-relationships.md %}#terminate-an-active-relationship) but not yet [decomposed]({% link _docs_integrate/terminate-relationships.md %}#decompose-a-relationship).
It can then only be received and processed if the [Relationship is reactivated]({% link _docs_integrate/terminate-relationships.md %}#reactivate-a-terminated-relationship).
Furthermore, the Notification is also queued if the [peer is currently in deletion]({% link _docs_integrate/delete-identities.md %}#effects-of-identity-deletion-on-relationships) but not yet deleted.
It can then only be received and processed if the peer [cancels its deletion]({% link _docs_use-cases/use-case-transport-cancel-identitydeletionprocess.md %}).

<div style="width: 640px; height: 480px; margin: 10px; position: relative;"><iframe allowfullscreen frameborder="0" style="width:640px; height:480px" src="https://lucid.app/documents/embedded/9aaf5a91-803b-4180-b0c7-4adb7bc5ced6" id="xQEl1j.jqJxq"></iframe></div>

Expand Down
Loading

0 comments on commit 02e5e20

Please sign in to comment.