Skip to content

ProtocolGenerator: replace IReadableXxxProperties with unified IXxxProperties. - #441

Merged
tmds merged 1 commit into
mainfrom
eliminate-ireadable-interface
May 12, 2026
Merged

ProtocolGenerator: replace IReadableXxxProperties with unified IXxxProperties.#441
tmds merged 1 commit into
mainfrom
eliminate-ireadable-interface

Conversation

@tmds

@tmds tmds commented May 12, 2026

Copy link
Copy Markdown
Owner

Write-only properties are uncommon and having a separate IReadableXxxProperties interfaces makes (explicit interface) implementations more verbose.

…operties.

Write-only properties are uncommon and having a separate IReadableXxxProperties interfaces makes (explicit interface) implementations more verbose.
@tmds
tmds merged commit 65a66b9 into main May 12, 2026
2 checks passed
@tmds
tmds deleted the eliminate-ireadable-interface branch May 20, 2026 08:39
JadeArkadian added a commit to JadeArkadian/FFXIV-Spanish-Patcher that referenced this pull request Jul 27, 2026
Updated [Tmds.DBus.Protocol](https://github.com/tmds/Tmds.DBus) from
0.21.3 to 0.94.2.

<details>
<summary>Release notes</summary>

_Sourced from [Tmds.DBus.Protocol's
releases](https://github.com/tmds/Tmds.DBus/releases)._

## 0.94.2

### Tmds.DBus.Generator

- Support interfaces with more than 64 readable properties (#​447).

## 0.94.1

### Tmds.DBus.Generator

- Fixed DBusHandler code only being generated for the last interface
when generating handler types for multiple interfaces (#​445).

## 0.94.0

### Tmds.DBus.Protocol

- `Func<ValueTask>` handler overloads added to avoid `async void` in
user code ([#​440](tmds/Tmds.DBus#440)).

### Tmds.DBus.Generator

- [Breaking] `IReadableXxxProperties` has been replaced with a unified
`IXxxProperties` interface. Write-only properties are uncommon and the
separate interface made explicit interface implementations more verbose
([#​441](tmds/Tmds.DBus#441)).
- Fix code generation for single-field D-Bus structs
([#​439](tmds/Tmds.DBus#439)).
- `DBusHandler.ParseInterface` now ignores missing interface string on
Properties requests
([#​442](tmds/Tmds.DBus#442)).

### Documentation

- Documentation rewritten into a single guide
([#​443](tmds/Tmds.DBus#443)).

## 0.93.0

## 0.93.0

### Tmds.DBus.Protocol

- [Breaking] Previously obsoleted types and APIs have been removed
(#​426):
  - `Connection` - use `DBusConnection` instead.
  - `ConnectionOptions` - use `DBusConnectionOptions` instead.
  - `ClientConnectionOptions` - use `DBusConnectionOptions` instead.
- `ClientSetupResult` - use `DBusConnectionOptions.SetupResult` instead.
  - `Address` - use `DBusAddress` instead.
  - `ActionException` - use `ObserverHandler` instead.
  - `IMethodHandler` - use `IPathMethodHandler` instead.
  - `DBusException` - use `DBusErrorReplyException` instead.
- `DisconnectedException` - use `DBusConnectionClosedException` instead.
  - `ConnectException` - use `DBusConnectFailedException` instead.
  - `ProtocolException` - use `DBusUnexpectedValueException` instead.
- `MethodContext.Connection` - use `MethodContext.DBusConnection`
instead.
- `AddMatchAsync` overloads that accept `Action<Exception?, T, object?,
object?>` are marked `Obsolete`. Use the new `Action<Notification<T>>`
overloads instead (#​427).
- `Notification<T>` / `Notification` / `NotificationType`: new callback
API for signal observers, replacing the `Action<Exception?, T, ...>`
pattern. Notifications distinguish between value, owner change, and
completion events (#​427).
- `NameOwnerWatcher`: tracks name ownership changes when calling methods
and watching signals, enabling detection of service restarts. A
`DBusOwnerChangedException`
is thrown when a method call targets an owner identifier from
`NameOwnerWatcher` and the owner has changed (#​425).
- `OnException` handler on `DBusConnectionOptions`: provides exception
reporting and disconnect control via the new `ExceptionContext` /
`ExceptionSource` types (#​431).

### Tmds.DBus.Generator

- The generator can now produce handler (server-side) types for
implementing D-Bus interfaces. To generate handlers, set the
`DBusGeneratorMode` property to `Handler`, to generate proxies set it to
`Proxy`. (#​429, #​433)
- [Breaking] Instead of a single action overload that accepts
`Action<Exception?, T>`, the generator generates a simple overload that
accepts `Action<T>` for users that are not interested in completion
notifications, and an `Action<Notification<T>>` overload to be notified
of completions. (#​427)
- [Breaking] To enable handler code to generate an `IXxxProperties`
interface, the generated proxy code changed as follows:
- The `GetPropertiesAsync` method now returns the concrete
`XxxProperties` class. When trying to get properties that were not set
the get accessor throws. Alternatively, users can call
`GetNullablePropertiesAsync` which returns an `INullableXxxProperties`
interface which returns `null` for properties that are not set.
- The `WatchPropertiesChanged` methods use a new `IChangedXxxProperties`
interface.

## 0.92.0

This release addresses vulnerabilities from malicious senders in
`Tmds.DBus` and `Tmds.DBus.Protocol`:

* Check the signal sender is the owner of the well-known name (fb41b95,
b429873)
* Prevent spilling of unix fds to the next message and limit the number
to 16 per message (4800917, f90642d)
* Prevent unhandled exceptions on SynchronizationContext due to a
malformed body sent by a malicious sender. (f0d9d0b, a64b8b9)

Advisory:
GHSA-xrw6-gwf8-vvr9

## 0.91.1

Tmds.DBus.Generator/Tmds.DBus.Tool:
* ProtocolGenerator: fix alignment when reading structs.
(tmds/Tmds.DBus#422)

## 0.91.0

Changes:
* Protocol: SignatureReader: mark type as Obsolete and remove dead code.
(tmds/Tmds.DBus#416)

Bug fixes/improvements:
* Protocol: change send message methods to be void instead of ValueTask.
(tmds/Tmds.DBus#404)
* Protocol: Reader: fix ReverseDoubleEndianness returning unreversed
value on pre-.NET8 targets. (tmds/Tmds.DBus#407)
* Protocol.Reader: limit array sizes to D-Bus max array length (64 MiB).
(tmds/Tmds.DBus#408)
* Protocol.Message: skip unknown header fields.
(tmds/Tmds.DBus#409)
* Protocol: enforce D-Bus max message length (128 MiB)
(tmds/Tmds.DBus#410)
* Fix DBusType.Signature alignment from 4 to 1.
(tmds/Tmds.DBus#411)
* Protocol: AddressReader: fix Unescape and TryGetNext off-by-one
errors. (tmds/Tmds.DBus#412)
* Protocol: DBusAddress: improve resource cleanup for X11/Windows,
refactor system/session address initialization.
(tmds/Tmds.DBus#413)
* Protocol: Reader: enforce max recursion depth (64) when reading
variant values. (tmds/Tmds.DBus#415)
* Protocol: Reader: ensure ReadSpan throws DBusReadException when null
terminator byte is missing. (tmds/Tmds.DBus#414)
* Protocol: Array/Struct/Dict: fix check for unsupported composite
types. (tmds/Tmds.DBus#418)
* Protocol: VariantValue: fix GetDictionaryEntry type check, fix
GetStructFieldType out-of-bounds check.
(tmds/Tmds.DBus#417)
* Protocol: MessageWriter: use Unsafe.SizeOf for JIT constant size.
(tmds/Tmds.DBus#419)
* Protocol: PathNodeDictionary: simplify batch RemoveMethodHandlers.
(tmds/Tmds.DBus#420)

## 0.90.3

* Revert the 0.90.0 change that passes reader/handler exceptions back to
the handler. (tmds/Tmds.DBus#403)

## 0.90.2

Tmds.DBus.Generator/Tmds.DBus.Tool:
* ProtocolGenerator: fix codegen causing (string?)null-conversion
instead of returning default(ObjectPath?) for ObjectPath properties.
(tmds/Tmds.DBus#402)

## 0.90.1

Tmds.DBus.Generator:
* Lower expected version of Microsoft.CodeAnalysis.CSharp to 4.12.0
(tmds/Tmds.DBus#400)

## 0.90.0

## Tmds.DBus.Protocol

This release does some refactoring which requires changes from the user.
The version is binary compatible with the previous version. `Obsolete`
attributes indicate what changes a user should make.

- These types have been renamed to be less generic:

```
`Connection` -> `DBusConnection` (tmds/Tmds.DBus#373)
`Address` -> `DBusAddress` (tmds/Tmds.DBus#372)
`ActionException` -> `ObserverHandler` (tmds/Tmds.DBus#371)
```

When you have code that requires the `Connection` type, you can call
`DBusConnection.AsConnection()`.

- The exception types have been refactored. A base type is introduced
for connection related errors, and one for errors related to a received
message. These base types also share a common base.
(tmds/Tmds.DBus#370,
tmds/Tmds.DBus#385,
tmds/Tmds.DBus#386,
tmds/Tmds.DBus#387).

```
DBusExceptionBase
├── DBusConnectionException
│   ├── DBusConnectionClosedException
│   │   └── DisconnectedException (obsolete -> DBusConnectionClosedException)
│   └── DBusConnectFailedException
│       └── ConnectException (obsolete -> DBusConnectFailedException)
└── DBusMessageException
    ├── DBusReadException
    ├── DBusErrorReplyException
    │   └── DBusException (obsolete -> DBusErrorReplyException)
    └── DBusUnexpectedValueException
        └── ProtocolException (obsolete -> DBusUnexpectedValueException)
```

Behavioral changes:

- The `Reader` throws `DBusReadException` when the message body and the
read operations mismatch. When trying to read a handle that was already
read, it throws `DBusUnexpectedValueException`.
(tmds/Tmds.DBus#385,
tmds/Tmds.DBus#399)
- When an observer reader/handler throws, we stop observing and pass the
exception to the handler. (tmds/Tmds.DBus#395)
- `Message.SignatureAsString` return an empty string when the signature
header is omitted. (tmds/Tmds.DBus#384)
- `Reader.ReadHandle` methods return a non-null handle to avoid user
having to do null-handling. (tmds/Tmds.DBus#364)

New APIs:

- A new `DBusService` type represents a peer reachable via the
connection. (tmds/Tmds.DBus#374)
- A new `DBusObject` type may be used as a base class for proxy classes.
(tmds/Tmds.DBus#376)
- A new `SkipSafeHandle` type may be used with the
`Reader.ReadHandle`/`VariantValue.ReadHandle` method to indicate a
handle should not be read. This enables letting the user decide to skip
reading the handle or not through what generic argument they are
passing. (tmds/Tmds.DBus#363)
- New methods are added to `DBusConnection` for watching signals and
property changes. (tmds/Tmds.DBus#376)

## Tmds.DBus.Generator

- This new package provides a Roslyn source generator that performs code
generation for the `Tmds.DBus.Protocol` API. Only proxies are supported.
(tmds/Tmds.DBus#378)

## Documentation
 ... (truncated)

## 0.23.0

Tmds.DBus.Protocol:
* Protocol: add hierarchical path support and improved async handling
for method handling. (#​360)
* Protocol: use non-blocking SynchronizationContext.Post instead of Send
for callbacks. (#​361)


## 0.22.0

Tmds.DBus:
* Fix libX11 library name. (tmds/Tmds.DBus#353)

Tmds.DBus.Protocol:
* Use .NET 9 System.Threading.Lock
(tmds/Tmds.DBus#331)
* Fix libX11 library name. (tmds/Tmds.DBus#353)
* Remove obsolete APIs (tmds/Tmds.DBus#355)
* Add request/release name APIs
(tmds/Tmds.DBus#356)

Tmds.DBus.Tool:
* codegen: remove unused invalidated list
(tmds/Tmds.DBus#334)

Commits viewable in [compare
view](tmds/Tmds.DBus@rel/0.21.3...rel/0.94.2).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Tmds.DBus.Protocol&package-manager=nuget&previous-version=0.21.3&new-version=0.94.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jade Arkadian <9055641+JadeArkadian@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant