Skip to content

Commit

Permalink
Apply suggestions from @kodebach
Browse files Browse the repository at this point in the history
Co-authored-by: Klemens Böswirth <23529132+kodebach@users.noreply.github.com>
  • Loading branch information
atmaxinger and kodebach committed Nov 1, 2022
1 parent 95f1c54 commit 271cf18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/decisions/operation_sequences.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ There is no real guideline of allowed and/or prohibited sequences, other than `k

We discovered that some sequences are currently legal but problematic for change tracking and maybe also other use cases.

Currently, notification plugins assume that a `kdbSet` operation for a certain parent key always directly follows the `kdbGet` operation for that same key.
Currently, notification plugins assume that a `kdbSet` operation for a certain parent key always follows the `kdbGet` operation for that same key, without a different `kdbGet` in between.
However, this is not enforced in any way within Elektra, nor is it documented that it should.

In applications, `kdbGet` and `kdbSet` of different parent keys might be interwoven in any way.
This is problematic, as plugins may store the result of `kdbGet` and use the stored data in the following `kdbSet` to calculate a changeset.
Plugins have to do this, as there isn't any other Elektra-provided mechanism currently to do change tracking for them.

Note, that erroneous behaviour only occurs if plugins are used globally, i.e. as `notification-send` hook plugins.
If they are mounted for specific backends (via `kdb mount`), this behaviour will not occur as plugins from different backends are isolated.
If they are mounted for specific backends (via `kdb mount`), this behaviour will not occur as plugins from different backends are isolated and backends are treated as an atomic unit with a single parent key.

### Reproducible Example

The following example will demonstrate the problematic sequence as real, runnable code.
This example will show the erroneous behaviour for the `dbus` and `logchange` plugins, if used as `notification-send` hooks.
These both plugins just serve as a general demonstration, and there may be more plugins that do change tracking this way.
These plugins both just serve as a general demonstration, and there may be more plugins that exhibit the problematic behaviour.

First, run some setup steps:

Expand Down

0 comments on commit 271cf18

Please sign in to comment.